1
0

monitoring: add snmp exporter

This commit is contained in:
Garionion 2022-07-24 16:52:54 +02:00
parent 29f8c7daf4
commit b5e87117aa
2 changed files with 39 additions and 5 deletions

View File

@ -21,14 +21,28 @@ with lib;
networking.defaultGateway = { address = "10.42.10.1"; interface = "ens18"; }; networking.defaultGateway = { address = "10.42.10.1"; interface = "ens18"; };
networking.defaultGateway6 = { address = "2a01:4f8:1c0c:8221::1"; interface = "ens18"; }; networking.defaultGateway6 = { address = "2a01:4f8:1c0c:8221::1"; interface = "ens18"; };
environment = {
etc = {
"snmp-exporter/snmp.yml".source = ./snmp.yml;
};
};
services.influxdb2.enable = true; services.influxdb2.enable = true;
services.prometheus.exporters.blackbox = { services.prometheus.exporters = {
blackbox = {
enable = true; enable = true;
listenAddress = "[::1]"; listenAddress = "[::1]";
port = 9115; port = 9115;
configFile = ./blackbox.yml; configFile = ./blackbox.yml;
}; };
snmp = {
enable = true;
port= 9116;
listenAddress = "[::1]";
configurationPath = "/etc/snmp-exporter/snmp.yml";
};
};
services.prometheus.exporters.node.enable = true; services.prometheus.exporters.node.enable = true;
systemd.services.waldbrandgefahrenstufen-exporter = { systemd.services.waldbrandgefahrenstufen-exporter = {
@ -253,6 +267,17 @@ with lib;
} }
]; ];
} }
{
job_name = "snmp";
scrape_interval = "5m";
static_configs = [
{
targets = [
"[::1]:9116"
];
}
];
}
]; ];
alertmanagers = [ alertmanagers = [
{ {
@ -289,16 +314,25 @@ with lib;
enable = true; enable = true;
virtualHosts = { virtualHosts = {
"prometheus.bula22.de" = { "prometheus.bula22.de" = {
serverAliases = [
"prometheus"
];
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/".proxyPass = "http://[::1]:9090/"; locations."/".proxyPass = "http://[::1]:9090/";
}; };
"grafana.bula22.de" = { "grafana.bula22.de" = {
serverAliases = [
"grafana"
];
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/".proxyPass = "http://[::1]:3001/"; locations."/".proxyPass = "http://[::1]:3001/";
}; };
"influxdb.bula22.de" = { "influxdb.bula22.de" = {
serverAliases = [
"influxdb"
];
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/".proxyPass = "http://[::1]:8086/"; locations."/".proxyPass = "http://[::1]:8086/";

View File