Set up monitoring via Prometheus and Grafana
This commit is contained in:
@@ -42,4 +42,41 @@ with pkgs;
|
||||
};
|
||||
};
|
||||
|
||||
# Metrics collection
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 9001;
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
enabledCollectors = [ "systemd" ];
|
||||
port = 9002;
|
||||
};
|
||||
zfs.enable = true;
|
||||
wireguard.enable = true;
|
||||
postgres.enable = true;
|
||||
smartctl.enable = true;
|
||||
#nginx.enable = true;
|
||||
dnsmasq.enable = true;
|
||||
};
|
||||
scrapeConfigs = [{
|
||||
job_name = "zion";
|
||||
static_configs = [{
|
||||
targets = [
|
||||
"localhost:${toString config.services.prometheus.exporters.node.port}"
|
||||
];
|
||||
}];
|
||||
}];
|
||||
};
|
||||
|
||||
# Grafana configuration
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
settings.server = {
|
||||
domain = "grafana.coolneng.duckdns.org";
|
||||
http_port = 9009;
|
||||
http_addr = "127.0.0.1";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user