61 lines
1.4 KiB
Nix
61 lines
1.4 KiB
Nix
|
{ config, pkgs, ... }:
|
||
|
|
||
|
let
|
||
|
cfg = config.services.prometheus;
|
||
|
in {
|
||
|
services.prometheus = {
|
||
|
enable = true;
|
||
|
listenAddress = "127.0.0.1";
|
||
|
port = 9001;
|
||
|
|
||
|
scrapeConfigs = [
|
||
|
{
|
||
|
job_name = "node";
|
||
|
static_configs = [
|
||
|
{
|
||
|
targets = [
|
||
|
"voyager.home.feal.no:${toString cfg.exporters.node.port}"
|
||
|
"sulu.home.feal.no:9100"
|
||
|
"mccoy.home.feal.no:9100"
|
||
|
"borg.home.feal.no:9100"
|
||
|
"troi.home.feal.no:9100"
|
||
|
"dlink-feal.home.feal.no:9100"
|
||
|
];
|
||
|
}
|
||
|
];
|
||
|
}
|
||
|
{
|
||
|
job_name = "openwrt";
|
||
|
static_configs = [
|
||
|
{ targets = ["dlink-feal.home.feal.no:9100"]; }
|
||
|
];
|
||
|
}
|
||
|
{
|
||
|
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";
|
||
|
}
|
||
|
];
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
}
|