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;
|
|
|
|
|
2023-12-26 11:45:12 +01:00
|
|
|
# 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 = [
|
2024-09-08 14:57:57 +02:00
|
|
|
"burnham.home.feal.no:9100"
|
2024-07-04 00:04:40 +02:00
|
|
|
"challenger.home.feal.no:9100"
|
|
|
|
"defiant.home.feal.no:9100"
|
2023-12-26 11:45:12 +01:00
|
|
|
"edison.home.feal.no:9100"
|
2024-09-08 14:57:57 +02:00
|
|
|
"malcolm.home.feal.no:9100"
|
2024-07-04 00:04:40 +02:00
|
|
|
"mccoy.home.feal.no:9100"
|
2023-12-26 11:45:12 +01:00
|
|
|
"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";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|