From c3b207395a0e62f2a8bc05208569a3f913eb022b Mon Sep 17 00:00:00 2001 From: Mic Szillat Date: Fri, 1 Nov 2024 20:12:11 +0100 Subject: [PATCH] Correct SNMP query (#36) --- src/jobs/traffic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jobs/traffic.rb b/src/jobs/traffic.rb index 11d9dc3..94c083b 100644 --- a/src/jobs/traffic.rb +++ b/src/jobs/traffic.rb @@ -8,7 +8,7 @@ prometheus = Prometheus::ApiClient.client(url: ENV['PROMETHEUS_URL']) def query(prometheus, q) - res = prometheus.query(query: "rate(if#{q}Octets{ifDescr=\"eth1\"}[2m])") + res = prometheus.query(query: "rate(if#{q}Octets{instance=\"10.1.0.1\", ifName=\"eth4\"}[2m])") res['result'][0]['value'][1].to_f * 8 end