Dear All,
Sharing How To Monitor Cisco Switches IN/OUT Traffic (Data Source Prometheus)
Templating Configuration
Retrieve Switches Device Name
Variable: $device
Query: label_values({job=“snmp”},instance)
Retrieve Switches Interface
Variable: $Interface
Query: query_result(ifHCOutOctets{job=“snmp”,instance="$Device"})
Regex: .interface="(.?)",.*
Metrics Query
To Get Inbound Traffic
irate(ifHCInOctets{job=‘snmp’,instance=’$Device’,interface=~’$Interface’}[5m])*8
To Have More Meaningful legend, I Use The Following
{{interface}} - In
To Get Outbound Traffic
irate(ifHCOutOctets{job=‘snmp’,instance=~’$Device’,interface=~’$Interface’}[5m]) * 8
To Have More Meaningful legend, I Use The Following
{{interface}} - Out