37 lines
1.5 KiB
Plaintext
37 lines
1.5 KiB
Plaintext
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"),
|
|
};
|
|
|
|
public static readonly List<Alerting.ITarget> Targets = new() {
|
|
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"),
|
|
}),
|
|
};
|
|
}
|
|
} |