defiant/metrics: Remove zfs exporter, fix snmp exporter

This commit is contained in:
Felix Albrigtsen 2023-12-26 15:46:41 +01:00 committed by Felix Albrigtsen
parent 773c961d55
commit 36613beb67
4 changed files with 3 additions and 25 deletions

View File

@ -5,6 +5,6 @@
./prometheus.nix ./prometheus.nix
./grafana.nix ./grafana.nix
./loki.nix ./loki.nix
#./snmp-exporter.nix ./snmp-exporter.nix
]; ];
} }

View File

@ -59,15 +59,6 @@ in {
} }
]; ];
} }
{
job_name = "zfs";
static_configs = [
{ targets = [
"voyager.home.feal.no:9134"
"defiant.home.feal.no:9134"
]; }
];
}
]; ];
}; };
} }

View File

@ -12,8 +12,8 @@
Type = "simple"; Type = "simple";
}; };
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.prometheus-snmp-exporter}/bin/snmp_exporter --config.file='/var/prometheus/snmp.yml'"; ExecStart = "${pkgs.prometheus-snmp-exporter}/bin/snmp_exporter --config.file='/tank/services/metrics/prometheus/snmp.yml'";
# TODO: Fix this conf file! # snmp.yml = https://github.com/prometheus/snmp_exporter/blob/main/snmp.yml + https://global.download.synology.com/download/Document/Software/DeveloperGuide/Firmware/DSM/All/enu/Synology_DiskStation_MIB_Guide.pdf
}; };
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
}; };

View File

@ -11,19 +11,6 @@
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
}; };
services.zfs.autoScrub.enable = true; services.zfs.autoScrub.enable = true;
services.prometheus.exporters.zfs = {
enable = true;
# "ip46" is cursed, do it manually below
# openFirewall = true;
# firewallFilter = "-p tcp -m tcp --source 192.168.10.175/32 --dport 9134";
};
networking.firewall = {
allowedTCPPorts = [ 9134 ];
extraCommands = ''
iptables -A INPUT -p tcp -m tcp --source 192.168.10.175/32 --dport 9134 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 9134 -j DROP
'';
};
# Network mounts (import) # Network mounts (import)
fileSystems = { fileSystems = {