Introduction
This document describes how to extract the various values concerning Class Based QoS (Quality of Service) details (CISCO-CLASS-BASED-QOS-MIB) applied against Control Plane using SNMP (Simple Network Management Protocol).
Prerequisites
Requirements
Cisco recommends that you have:
- Net-SNMP, or any similar command line based utility, running on a UNIX based operating system, for polling SNMP MIBs (Management Information Bases) from a Cisco device. Net-SNMP is a third-party open source utility available for download at http://www.net-snmp.org/.
- QoS should be configured and applied on the interface(s) for which you will do SNMP polling.
Components Used
The information in this document is based on these software and hardware versions:
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Get Class Based QoS Details Applied to an Interface With SNMP
Use this procedure in order to determine or confirm the required Object Identifier (OID) for polling.
- Get the ifindex (Object Identifier/OID 1.3.6.1.2.1.2.2.1.1) for the interface.
Example 1 - CLI command to get the ifindex of the interface GigabitEthernet6/1/3:show snmp mib ifmib ifindex | include GigabitEthernet6/1/3
GigabitEthernet6/1/3: Ifindex = 73
Example 2 - SNMP command to get the ifindex of the same interface:UNIX #snmpwalk -v2c -c <community-name> <ip address of device> 1.3.6.1.2.1.2.2 | grep -i GigabitEthernet6/1/3
IF-MIB::ifDescr.73 = STRING: GigabitEthernet6/1/3
The ifindex value returned in these examples is 73.
- Get the cbQosIfIndex (OID 1.3.6.1.4.1.9.9.166.1.1.1.1.4) for the ifindex you retrieved in Step 1.
Example - SNMP command to get the cbQosIfIndex for ifindex 73:UNIX #snmpwalk -v2c -c <community-name> <ip address of device> 1.3.6.1.4.1.9.9.166.1.1.1.1.4 | grep -i 73
SNMPv2-SMI::enterprises.9.9.166.1.1.1.1.4.1170 = INTEGER: 73
The cbQosPolicyIndex (OID 1.3.6.1.4.1.9.9.166.1.1.1.1.1) value returned in this example is 1170.
- Use the MIB Object cbQosCMName (1.3.6.1.4.1.9.9.166.1.7.1.1.1) to get the names of class-maps configured on the router.
The output will show each class-map with its Index. For example, cbQosConfigIndex (1.3.6.1.4.1.9.9.166.1.5.1.1.2).
UNIX #snmpwalk -v2c -c <community-name> <ip address of device> 1.3.6.1.4.1.9.9.166.1.7.1.1.1
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.1593 = STRING: "class-default"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.1874801 = STRING:"DOMESTIC_IN
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.5134417 = STRING:"INTERNATIONAL_IN"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.6181089 = STRING:"DOMESTIC_OUT"
SNMPv2-SMI::enterprises.9.9.166.1.7.1.1.1.12374209 = STRING:"INTERNATIONAL_OUT"
Make a note of the highlighted value 6181089, which is cbQosConfigIndex.
- Use cbQosConfigIndex to get the cbQosPolicyIndex (1.3.6.1.4.1.9.9.166.1.1.1.1.1) and cbQosObjectsIndex (1.3.6.1.4.1.9.9.166.1.5.1.1.1) for individual class-maps.
Example - command to monitor class-map DOMESTIC_OUT:UNIX #snmpwalk -v2c -c <community-name> <ip address of device> 1.3.6.1.4.1.9.9.166.1.5.1.1.2
- In order to get the Object Identifier (OID), search for the cbQosConfigIndex value obtained in Step 3 (6181089) in the output below:
UNIX #snmpwalk -v2c -c <community-name> <ip address of device> 1.3.6.1.4.1.9.9.166.1.5.1.1.2 grep -i 'Gauge32: 6181089'
SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.352.352 = Gauge32: 11986352
SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.352.1163651 = Gauge32: 9637091
SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.352.7200738 = Gauge32: 1594
SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.352.10567713 = Gauge32: 1593
SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.354.354 = Gauge32: 11986352
SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.354.431603 = Gauge32: 9637091
SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.1170.7552545 = Gauge32: 6181089
The highlighted values are: cbQosConfigIndex (6181089), cbQosPolicyIndex (1170), and cbQosObjectsIndex (7552545).
Important: In this example, the cbQosConfigIndex and corresponding cbQosObjectsIndex are for the cbQosObjectsType (1.3.6.1.4.1.9.9.166.1.5.1.1.3) "classmap". For any other type of cbQosObjectsType, you must look into the correlation derived under cbQosObjects as part of cbQosObjectsIndex (1.3.6.1.4.1.9.9.166.1.5.1.1.3). Refer to the definition of cbQosParentObjectsIndex.
- Poll data from the Policy-map (in correlation with QosObjectsType=classmap) from cbQosClassMapStats (1.3.6.1.4.1.9.9.166.1.15). Many options are available:
+-- -R-- Counter cbQosCMPrePolicyPktOverflow(1)
+-- -R-- Counter cbQosCMPrePolicyPkt(2)
+-- -R-- Counter64 cbQosCMPrePolicyPkt64(3)
+-- -R-- Counter cbQosCMPrePolicyByteOverflow(4)
+-- -R-- Counter cbQosCMPrePolicyByte(5)
+-- -R-- Counter64 cbQosCMPrePolicyByte64(6)
+-- -R-- Gauge cbQosCMPrePolicyBitRate(7)
+-- -R-- Counter cbQosCMPostPolicyByteOverflow(8)
+-- -R-- Counter cbQosCMPostPolicyByte(9)
+-- -R-- Counter64 cbQosCMPostPolicyByte64(10)
+-- -R-- Gauge cbQosCMPostPolicyBitRate(11)
+-- -R-- Counter cbQosCMDropPktOverflow(12)
+-- -R-- Counter cbQosCMDropPkt(13)
+-- -R-- Counter64 cbQosCMDropPkt64(14)
+-- -R-- Counter cbQosCMDropByteOverflow(15)
+-- -R-- Counter cbQosCMDropByte(16)
+-- -R-- Counter64 cbQosCMDropByte64(17)
+-- -R-- Gauge cbQosCMDropBitRate(18)
+-- -R-- Counter cbQosCMNoBufDropPktOverflow(19)
-- -R-- Counter cbQosCMNoBufDropPkt(20)
-- -R-- Counter64 cbQosCMNoBufDropPkt64(21)
Refer to the SNMP MIB Locator for MIBs for these options.
For example, the object cbQosCMPostPolicyBitRate (1.3.6.1.4.1.9.9.166.1.15.1.1.11) polls the bit rate of the traffic after QoS policy execution.
Example - command to get the post policy bit rate:
UNIX # snmpwalk -v2c -c <community-name> <ip address of device> 1.3.6.1.4.1.9.9.166.1.15.1.1.11.1170.7552545
SNMPv2-SMI::enterprises.9.9.166.1.15.1.1.11.1170.7552545 = Gauge32: 27000
The highlighted values are: cbQosPolicyIndex (1170), cbQosObjectsIndex (7552545), and the bit rate in bits per second (27000).Below is an excerpt of the CLI output from command to get the post policy bit rate:
- Get policy-map information from the router and compare it to the information obtained in previous steps.
Use the following CLI command:Router # show policy-map interface GigabitEthernet6/1/3
The following excerpt of the command output shows an example of information to compare for verification:Class-map: DOMESTIC_OUT (match-any) (7552545/2)
8170810 packets, 979471829 bytes
5 minute offered rate 27000 bps, drop rate 0 bps
Match: any (5213858)
police:
1024000000 bps, 16777215 limit, 16777215 extended limit
conformed 8170810 packets, 979471829 bytes; actions:
transmit
exceeded 0 packets, 0 bytes; actions:
drop
conformed 27000 bps, exceed 0 bps
Review the output in order to verify that the data you are polling is correct.
Related Information