Setup SNMP for a CISCO Switch
I am now going to configure Prometheus to query SNMP from my Cisco Switch.
My Cisco Switch is a 24 Port Cisco Catalyst 2950.
After doing a factory reset of the Switch, It has
- SNMP enabled
- The default gateway set to the IP address of my main network router that is connected to the internet
On my switch, I can telnet to it and see the configuration.
1 2 3 4 5
The response shows that my switch is configured with an IP address, a default gateway, and an SNMP read only community.
1 2 3 4 5 6
On my internet firewall/router, I have created a new forwarding rule external port 161 to internal port 161 IP address 192.168.1.1
I have also verified that I can do some basic SNMP queries from the command line on my Prometheus server.
I then add my internet routers external IP address to the prometheus.yml configuration for the SNMP scrape target, and Prometheus is now able to query the SNMP properties of my switch through the SNMP exporter process.
I can verify that i am seeing data in Prometheus by querying the ifInOctets metric. This shows a new metric for every ethernet interface on my Switch.
SNMP Exporter if_mib Grafana Dashboard
This is a dashboard was written specifically for the if_mib module that is configured in the snmp.yml and referenced in the prometheus.yml for the SNMP job used by the SNMP Exporter.
This dashboard is very generic and will be a good starting point to work from.