ping_exporter: also add to fra1-b and vno1-gdrx

This commit is contained in:
2024-09-16 14:49:07 +03:00
parent 4eb57ba5e7
commit c9d69cc3e6
5 changed files with 90 additions and 49 deletions

View File

@@ -15,6 +15,7 @@
./minidlna
./node_exporter
./nsd-acme
./ping_exporter
./photoprism
./postfix
./remote-builder

View File

@@ -0,0 +1,47 @@
{
config,
lib,
myData,
...
}:
let
cfg = config.mj.services.ping_exporter;
in
{
options.mj.services.ping_exporter = with lib.types; {
enable = lib.mkEnableOption "Enable ping_exporter";
};
config = lib.mkIf cfg.enable {
services.prometheus.exporters.ping = {
enable = true;
settings = {
options.disableIPv6 = true;
ping = {
interval = "1s";
timeout = "5s";
history-size = 10;
};
targets = [
"1.1.1.1"
"8.8.4.4"
"fb.com"
"rrt.lt"
"kam.lt"
"lrs.lt"
"15min.lt"
"fra1-b.jakstys.lt"
myData.hosts."fra1-b.servers.jakst".jakstIP
];
};
};
mj.services.friendlyport.ports = [
{
subnets = [ myData.subnets.tailscale.cidr ];
tcp = [ config.services.prometheus.exporters.ping.port ];
}
];
};
}