config/modules/services/snmp_exporter/default.nix

29 lines
609 B
Nix
Raw Normal View History

2023-09-05 14:41:52 +03:00
{
config,
lib,
pkgs,
2023-09-12 15:46:44 +03:00
myData,
2023-09-05 14:41:52 +03:00
...
}: {
options.mj.services.snmp_exporter = with lib.types; {
enable = lib.mkEnableOption "Enable prometheus snmp_exporter";
};
config = lib.mkIf config.mj.services.snmp_exporter.enable {
2023-09-12 15:46:44 +03:00
mj.services.friendlyport.ports = [
{
2023-09-12 16:08:08 +03:00
subnets = [myData.subnets.tailscale.cidr];
2023-09-12 15:46:44 +03:00
tcp = [config.services.prometheus.exporters.snmp.port];
}
];
2023-09-05 14:41:52 +03:00
services.prometheus.exporters.snmp = {
enable = true;
configurationPath = pkgs.concatTextFile {
name = "snmp.yml";
files = [./snmp.yml];
};
2023-09-05 14:41:52 +03:00
};
};
}