2
2
mirror of https://git.feal.no/felixalb/nixos-config.git synced 2024-12-23 12:37:30 +01:00
nixos-config/hosts/defiant/services/monitoring/prometheus.nix

60 lines
1.4 KiB
Nix
Raw Normal View History

2023-04-15 20:44:47 +02:00
{ config, pkgs, ... }:
let
cfg = config.services.prometheus;
in {
services.prometheus = {
enable = true;
listenAddress = "127.0.0.1";
port = 9001;
# StateDirectory must be under /var/lib.
# TODO: Back up to /tank/services/metrics/prometheus
2023-04-15 20:44:47 +02:00
scrapeConfigs = [
{
job_name = "node";
static_configs = [
{
targets = [
"burnham.home.feal.no:9100"
2024-07-04 00:04:40 +02:00
"challenger.home.feal.no:9100"
"defiant.home.feal.no:9100"
"edison.home.feal.no:9100"
"malcolm.home.feal.no:9100"
2024-07-04 00:04:40 +02:00
"mccoy.home.feal.no:9100"
"scotty.home.feal.no:9100"
2024-07-04 00:04:40 +02:00
"sulu.home.feal.no:9100"
2023-04-15 20:44:47 +02:00
];
}
];
}
{
job_name = "snmp";
static_configs = [{
targets = [
"feal-syn1.home.feal.no"
"feal-syn2.home.feal.no"
];
}];
metrics_path = "/snmp";
params.module = ["synology"];
relabel_configs = [
{
source_labels = ["__address__"];
target_label = "__param_target";
}
{
source_labels = ["__param_target"];
target_label = "instance";
}
{
target_label = "__address__";
replacement = "127.0.0.1:9116";
}
];
}
];
};
}