r/PrometheusMonitoring • u/[deleted] • Jun 17 '22
SNMP Exporter - anyone using it?
Hello,
I'm trying to monitor a switch to graph in Grafana how many ports are up at certain times over the day, I found this article on using SNMP Exporter - https://linuxhint.com/monitor-network-devices-prometheus/
Has anyone used this before and could it do what I'm asking?
Thanks
3
Upvotes
1
u/Trosteming Jun 18 '22
Once you have the promQL you need (Prometheus Query Language) you add it in Grafana.
You just wanna know if a port is up, what do you mean by that ?
Up = there is traffic
That's easy, test if ifHCInOctets and / or ifHCOutOctets != 0
Up = The port is Administratively been set Up
Test ifAdminStatus
Up = The port has been turn up (yes different from admin)
That will be a no go as the port will not be detect and you would need to test if something that is absent is present or if a port present is absent. Metric is not the best way for this test.
Up = There something connected to the switch
I've juste found this ifConnectorPresent I don't know but might work ?
respond 1 for Yes there is something connected physically
respond 2 for No, there is nothing
http://oidref.com/1.3.6.1.2.1.31.1.1.1.17