diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2024-11-09 19:02:57 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2024-11-09 19:02:57 +0100 |
commit | 1294c718ea1757662fede1fee8a0775f671a9e00 (patch) | |
tree | c59fb66deea3d012a252e7d1ffcb10f8c0cb7371 | |
parent | 8ceb4bbe219230a7e8297f7bd78c141202454dba (diff) | |
download | infra-1294c718ea1757662fede1fee8a0775f671a9e00.tar.gz infra-1294c718ea1757662fede1fee8a0775f671a9e00.tar.bz2 infra-1294c718ea1757662fede1fee8a0775f671a9e00.tar.xz infra-1294c718ea1757662fede1fee8a0775f671a9e00.zip |
snmp
-rw-r--r-- | README-snmp.md | 19 | ||||
-rw-r--r-- | terraform/hash-prometheus/prometheus.yml | 62 |
2 files changed, 81 insertions, 0 deletions
diff --git a/README-snmp.md b/README-snmp.md new file mode 100644 index 0000000..e4ec3fe --- /dev/null +++ b/README-snmp.md @@ -0,0 +1,19 @@ +# Collecting SNMP data with Prometheus + +Use the `prometheus-snmp-exporter` package. + +## Generating snmp.yml + +This file is not included in the Debian packages for licensing reasons, and we +also want to include the Ubiquiti MIBs anyway. + +Main docs: https://github.com/prometheus/snmp_exporter/tree/main/generator + +Short story: + +* git clone https://github.com/prometheus/snmp_exporter.git +* make generate +* make mibs # downloads the MIBs, including the UBNT ones +* ./generator generate -m mibs -g generator.yml -o snmp.yml + +Copy `snmp.yml` to `/etc/prometheus/snmp.yml`. diff --git a/terraform/hash-prometheus/prometheus.yml b/terraform/hash-prometheus/prometheus.yml index b9e6e5a..5f74367 100644 --- a/terraform/hash-prometheus/prometheus.yml +++ b/terraform/hash-prometheus/prometheus.yml @@ -27,3 +27,65 @@ scrape_configs: - targets: - "conflatorio.dn42.trygvis.io:9177" - "hash.dn42.trygvis.io:9177" + + - job_name: snmp_kv24_ap + scrape_interval: 300s + static_configs: + - targets: + - "192.168.10.20" + - "192.168.10.21" + - "192.168.10.22" + - "192.168.10.23" + - "192.168.10.25" + - "192.168.10.26" + metrics_path: /snmp + params: + auth: [public_v2] + module: + - if_mib + - ubiquiti_unifi + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: "coregonus.dn42.trygvis.io:9116" + + - job_name: snmp_kv24_sw + scrape_interval: 60s + static_configs: + - targets: + - "192.168.10.10" + - "192.168.10.11" + - "192.168.10.12" + metrics_path: /snmp + params: + auth: [public_v2] + module: + - if_mib + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: "coregonus.dn42.trygvis.io:9116" + + - job_name: snmp_kv24_router + scrape_interval: 60s + static_configs: + - targets: + - "192.168.10.1" + metrics_path: /snmp + params: + auth: [public_v2] + module: + - if_mib + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: "coregonus.dn42.trygvis.io:9116" |