Skip to content

Commit d3341d7

Browse files
committed
snmp_exporter: init
1 parent d25e6ae commit d3341d7

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

hosts/svc-exp01/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
imports = [
33
./configuration.nix
44
../../modules/obs/sflow_exporter.nix
5+
../../modules/obs/snmp_exporter.nix
56
];
67
}

modules/obs/prometheus-all.nix

+27
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,33 @@ in
103103
];
104104
}];
105105
}
106+
{
107+
job_name = "snmp";
108+
metrics_path = "/snmp";
109+
params = {
110+
module = [ "arista_sw" ];
111+
};
112+
relabel_configs = [
113+
{
114+
"source_labels" = [ "__address__" ];
115+
"target_label" = "__param_target";
116+
}
117+
{
118+
"source_labels" = [ "__param_target" ];
119+
"target_label" = "instance";
120+
}
121+
{
122+
"target_label" = "__address__";
123+
"replacement" = "svc-exp01.dd-ix.net:9116";
124+
}
125+
];
126+
static_configs = [{
127+
targets = [
128+
"ixp-c2-sw01.dd-ix.net"
129+
"ixp-cc-sw01.dd-ix.net"
130+
];
131+
}];
132+
}
106133
];
107134
};
108135

modules/obs/snmp_exporter.nix

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
services.prometheus.exporters.snmp = {
3+
enable = true;
4+
configurationPath = builtins.fetchurl {
5+
url = "https://raw.githubusercontent.com/prometheus/snmp_exporter/main/snmp.yml";
6+
sha256 = "sha256:16w3zgi8dgwx72a47y8qywxg6dfs0p032v233m8vrn2f5biy5n25";
7+
};
8+
openFirewall = true;
9+
};
10+
}

0 commit comments

Comments
 (0)