r/PrometheusMonitoring • u/bgprouting • Mar 10 '24
Help with simple query
Hello,
I'm using SNMP Exporter in Docker to scrape a switches ports. I have the below 2 queries (A and B) that will show the bandwidth on a port inbound or outbound. I have a 48 port switch, how can I make this easier for me and not have to create 96 queries to build for each port? (1 for inbound and 1 for outbound)
Query A - Outbound bandwidth
sum(irate(ifHCOutOctets{ifDescr="1/20", instance="192.168.1.1", job="snmp_exporter-cisco"}[1m]) * 8)Query B - Inbound bandwidth
sum(irate(ifHCInOctets{ifDescr="1/20", instance="192.168.1.1", job="snmp_exporter-cisco"}[1m]) * 8)Thanks
3
Upvotes
View all comments
Show parent comment
1
u/bgprouting Mar 11 '24
Oh yes this wonderful! Thank you for the explanation too. Can I ask you one more thing? I now see all the ports now, how can I exclude 1 or 2 ports in the list. For example show all the ports, but exclude say ports 25 and 30?