monithor/Monithor.api/Config.cs.template

37 lines
1.5 KiB
Plaintext
Raw Normal View History

2021-05-13 22:38:00 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using Monithor.api.Monitors;
using Telegram.Bot;
namespace Monithor.api {
public static class Config {
public static readonly TelegramBotClient TgClient = new("your-telegram-bot-token");
public const string Org = "your-influx2-org";
public const string Bucket = "your-influx2-bucket";
public const string Token = "your-influx2-token";
public const string Url = "https://your.influxdb.instance";
public const string AdminHost = "your.admin.domain";
public static readonly List<IMonitor> Monitors = new() {
new TcpMonitor("placeholder-tcp", "your.domain", "22"),
new HttpMonitor("placeholder-http", "https://your.domain"),
new IcmpMonitor("placeholder-icmp", "host.your.domain"),
};
2021-05-18 17:13:21 +02:00
public static readonly List<Alerting.ITarget> Targets = new() {
2021-05-13 22:38:00 +02:00
new Alerting.TelegramTarget(TgClient, "1234", Monitors.First(p => p.Identifier == "placeholder-tcp"), "your.status.page", "SSH"),
new Alerting.TelegramTarget(TgClient, "1234", Monitors.First(p => p.Identifier == "placeholder-icmp"), "your.status.page", "Server"),
};
public static readonly List<StatusPage> StatusPages = new() {
new StatusPage("your.domain", "your.status.page",
new List<(IMonitor, string)> {
new(Monitors.First(p => p.Identifier == "placeholder-icmp"), "Server"),
new(Monitors.First(p => p.Identifier == "placeholder-http"), "Website"),
new(Monitors.First(p => p.Identifier == "placeholder-tcp"), "SSH"),
}),
};
}
}