Cisco Class-Based QoS SNMP MIB and statistics monitor for NMS

As stated in the official CISCO-CLASS-BASED-QOS-MIB file, Cisco Class-Based QoS MIB “provides read access to Quality of Service (QoS) configuration and statistics information for Cisco platforms that support the Modular Quality of Service Command-line Interface“.

In other words, the integration of this MIB in a SNMP-based NMS lets you to monitor all the values you can see with the show policy-map IOS command.

This MIB has not a so straightforward structure as other MIBs have, so integration with NMS can be a little diffcult.

Let’s take a deeper look at its structure; in a future post I’ll show how to use this information to monitor IOS QoS statistics in Zabbix.

We’ll use the following trivial IOS configuration for our examples:

class-map match-any NonLocal
 match access-group 10
!
class-map match-all ICMP
 match protocol icmp
!
policy-map CPP
  description Applied to control plan - In
 class NonLocal
   police cir 8000
     conform-action transmit
     exceed-action drop
!
policy-map LAN_Out
  description Applied to fa0/0 - Out
 class ICMP
  bandwidth 10
 class class-default
  fair-queue
!
interface FastEthernet0/0
 ip address 192.168.0.8 255.255.255.0
 service-policy output LAN_Out
!
access-list 10 deny   192.168.0.0 0.0.0.255
access-list 10 permit any
!
control-plane
 service-policy input CPP

In this MIB informations are stored on a lot of tables:

  • cbQosServicePolicyTable and cbQosObjectsTable define QoS policies layout;
  • cbQosXXXCfgTable tables define configuration details for the objects (ClassMap, PolicyMap, Match statements…);
  • cbQosXXXStatsTable tables define runtime statistics for the same objects.

As first, we have to look at cbQosServicePolicyTable: here we find bindings between policy-maps and interfaces, as in the service-policy command:

cbQosServicePolicyTable
-----------------------

# snmpwalk -v 2c -c public -m ALL 192.168.0.8 .1.3.6.1.4.1.9.9.166.1.1.1

CISCO-CLASS-BASED-QOS-MIB::cbQosIfType.1043 = INTEGER: mainInterface(1)
CISCO-CLASS-BASED-QOS-MIB::cbQosIfType.1099 = INTEGER: controlPlane(5)
CISCO-CLASS-BASED-QOS-MIB::cbQosPolicyDirection.1043 = INTEGER: output(2)
CISCO-CLASS-BASED-QOS-MIB::cbQosPolicyDirection.1099 = INTEGER: input(1)
CISCO-CLASS-BASED-QOS-MIB::cbQosIfIndex.1043 = INTEGER: 1
CISCO-CLASS-BASED-QOS-MIB::cbQosIfIndex.1099 = INTEGER: 1
CISCO-CLASS-BASED-QOS-MIB::cbQosFrDLCI.1043 = INTEGER: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosFrDLCI.1099 = INTEGER: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosAtmVPI.1043 = Gauge32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosAtmVPI.1099 = Gauge32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosAtmVCI.1043 = Gauge32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosAtmVCI.1099 = Gauge32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosEntityIndex.1043 = INTEGER: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosEntityIndex.1099 = INTEGER: 0

cbQosPolicyIndex is the table’s index (1043, 1099 in the previous example); it identifies the service-policy.

cbQosIfType defines the type of interface which the service-policy is applied to: mainInterface(1), subInterface(2), frDLCI(3), atmPVC(4), controlPlane(5), vlanPort(6).

cbQosPolicyDirection tells the direction of the traffic: input(1) and output(2).

Other parameters depend on cbQosIfType value and represent specific objects identifiers (ifIndex, DLCI, VPI/VCI, … ).

From the previous example we can see there are 2 service-policies, with ID 1043 and 1099, applied for output traffic to a physical interface with ifIndex 1, and for input traffic to the control-plane.

The second important table is cbQosObjectsTable, where all objects (class-map, match, set statements…) are stored, classified (cbQosObjectsType), identified within the configuration (cbQosConfigIndex) and related to the service-policy or other objects (cbQosParentObjectsIndex). Here we have a two-fields index: cbQosPolicyIndex and cbQosObjectsIndex:

cbQosObjectsTable
-----------------

# snmpwalk -v 2c -c public -m ALL 192.168.0.8 .1.3.6.1.4.1.9.9.166.1.5.1

CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1043 = Gauge32: 1035
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1045 = Gauge32: 1029
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1047 = Gauge32: 1033
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1049 = Gauge32: 1037
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1051 = Gauge32: 1025
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1053 = Gauge32: 1027
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1085 = Gauge32: 1079
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1099 = Gauge32: 1063
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1101 = Gauge32: 1057
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1103 = Gauge32: 1061
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1105 = Gauge32: 1065
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1107 = Gauge32: 1025
CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1109 = Gauge32: 1027
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1043 = INTEGER: policymap(1)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1045 = INTEGER: classmap(2)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1047 = INTEGER: matchStatement(3)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1049 = INTEGER: queueing(4)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1051 = INTEGER: classmap(2)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1053 = INTEGER: matchStatement(3)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1085 = INTEGER: queueing(4)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1099.1099 = INTEGER: policymap(1)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1099.1101 = INTEGER: classmap(2)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1099.1103 = INTEGER: matchStatement(3)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1099.1105 = INTEGER: police(7)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1099.1107 = INTEGER: classmap(2)
CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1099.1109 = INTEGER: matchStatement(3)
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1043.1043 = Gauge32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1043.1045 = Gauge32: 1043
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1043.1047 = Gauge32: 1045
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1043.1049 = Gauge32: 1045
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1043.1051 = Gauge32: 1043
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1043.1053 = Gauge32: 1051
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1043.1085 = Gauge32: 1051
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1099.1099 = Gauge32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1099.1101 = Gauge32: 1099
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1099.1103 = Gauge32: 1101
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1099.1105 = Gauge32: 1101
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1099.1107 = Gauge32: 1099
CISCO-CLASS-BASED-QOS-MIB::cbQosParentObjectsIndex.1099.1109 = Gauge32: 1107

cbQosConfigIndex let us to find configuration details about objects in other tables; service-policies have the same cbQosObjectsIndex as cbQosPolicyIndex. These config tables are cbQosObjectsType dependent: we have cbQosPolicyMapCfgTable, cbQosClassMapCfgTable, cbQosMatchStmtCfgTable… each object type has its own table, all referenced by cbQosConfigIndex.

Let’s see one of them…

cbQosPolicyMapCfgTable
----------------------

# snmpwalk -v 2c -c public -m ALL 192.168.0.8 .1.3.6.1.4.1.9.9.166.1.6.1

CISCO-CLASS-BASED-QOS-MIB::cbQosPolicyMapName.1035 = STRING: LAN_Out
CISCO-CLASS-BASED-QOS-MIB::cbQosPolicyMapName.1063 = STRING: CPP
CISCO-CLASS-BASED-QOS-MIB::cbQosPolicyMapDesc.1035 = STRING: Applied to fa0/0 - Out
CISCO-CLASS-BASED-QOS-MIB::cbQosPolicyMapDesc.1063 = STRING: Applied to control plan - In

We can see here our policy-maps, indexed by the cbQosConfigIndex values previously found on cbQosObjectsTable.

With the cbQosObjectsTable data we already have all informations we need to build an OID list for our NMS.

Assume we just need to monitor class-map offered rate and drop rate, as in the show policy-map interface | inc Class-map|offered. All per class-map statistics are collected on the cbQosCMStatsTable; as all stats table, it’s indexed by cbQosPolicyIndex and cbQosObjectsIndex. Take a look at the table:

cbQosCMStatsTable
-----------------

# snmpwalk -v 2c -c public -m ALL 192.168.0.8 .1.3.6.1.4.1.9.9.166.1.15.1.1

CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPktOverflow.1043.1045 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPktOverflow.1043.1051 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPktOverflow.1099.1101 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPktOverflow.1099.1107 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt.1043.1045 = Counter32: 8
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt.1043.1051 = Counter32: 1131
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt.1099.1101 = Counter32: 281
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt.1099.1107 = Counter32: 7016
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt64.1043.1045 = Counter64: 8
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt64.1043.1051 = Counter64: 1131
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt64.1099.1101 = Counter64: 281
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyPkt64.1099.1107 = Counter64: 7016
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByteOverflow.1043.1045 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByteOverflow.1043.1051 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByteOverflow.1099.1101 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByteOverflow.1099.1107 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte.1043.1045 = Counter32: 784
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte.1043.1051 = Counter32: 114630
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte.1099.1101 = Counter32: 69858
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte.1099.1107 = Counter32: 658800
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte64.1043.1045 = Counter64: 784
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte64.1043.1051 = Counter64: 114630
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte64.1099.1101 = Counter64: 69858
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyByte64.1099.1107 = Counter64: 658800
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.1043.1045 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.1043.1051 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.1099.1101 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.1099.1107 = Gauge32: 1000 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByteOverflow.1043.1045 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByteOverflow.1043.1051 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByteOverflow.1099.1101 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByteOverflow.1099.1107 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte.1043.1045 = Counter32: 784
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte.1043.1051 = Counter32: 114630
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte.1099.1101 = Counter32: 69668
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte.1099.1107 = Counter32: 658800
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte64.1043.1045 = Counter64: 784
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte64.1043.1051 = Counter64: 114630
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte64.1099.1101 = Counter64: 69668
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyByte64.1099.1107 = Counter64: 658800
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyBitRate.1043.1045 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyBitRate.1043.1051 = Gauge32: 2000 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyBitRate.1099.1101 = Gauge32: 2000 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyBitRate.1099.1107 = Gauge32: 2000 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPktOverflow.1043.1045 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPktOverflow.1043.1051 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPktOverflow.1099.1101 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPktOverflow.1099.1107 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt.1043.1045 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt.1043.1051 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt.1099.1101 = Counter32: 4
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt.1099.1107 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt64.1043.1045 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt64.1043.1051 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt64.1099.1101 = Counter64: 4
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropPkt64.1099.1107 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByteOverflow.1043.1045 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByteOverflow.1043.1051 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByteOverflow.1099.1101 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByteOverflow.1099.1107 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte.1043.1045 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte.1043.1051 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte.1099.1101 = Counter32: 380
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte.1099.1107 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte64.1043.1045 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte64.1043.1051 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte64.1099.1101 = Counter64: 380
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropByte64.1099.1107 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.1043.1045 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.1043.1051 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.1099.1101 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.1099.1107 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPktOverflow.1043.1045 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPktOverflow.1043.1051 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPktOverflow.1099.1101 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPktOverflow.1099.1107 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPkt.1043.1045 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPkt.1043.1051 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPkt.1099.1101 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPkt.1099.1107 = Counter32: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPkt64.1043.1045 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPkt64.1043.1051 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPkt64.1099.1101 = Counter64: 0
CISCO-CLASS-BASED-QOS-MIB::cbQosCMNoBufDropPkt64.1099.1107 = Counter64: 0

We just need to select cbQosPolicyIndex and cbQosObjectsIndex values from cbQosObjectsTable where cbQosObjectsType = classmap(2) and attach them to the counter we need to monitor.

CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.1043.1045 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.1043.1051 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.1099.1101 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPrePolicyBitRate.1099.1107 = Gauge32: 1000 bits per second

CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyBitRate.1043.1045 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyBitRate.1043.1051 = Gauge32: 2000 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyBitRate.1099.1101 = Gauge32: 2000 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMPostPolicyBitRate.1099.1107 = Gauge32: 2000 bits per second

CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.1043.1045 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.1043.1051 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.1099.1101 = Gauge32: 0 bits per second
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDropBitRate.1099.1107 = Gauge32: 0 bits per second

To have more details about the ClassMap statements to which these stats are related we can look at their configuration: as first we need their cbQosConfigIndex:

# snmpget -v 2c -c public -m ALL 192.168.0.8 .1.3.6.1.4.1.9.9.166.1.5.1.1.2.1043.1045

CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1045 = Gauge32: 1029

With cbQosConfigIndex we can get class-map details; this is the cbQosCMCfgTable table:

cbQosCMCfgTable
----------------

# snmpwalk -v 2c -c public -m ALL 192.168.0.8 .1.3.6.1.4.1.9.9.166.1.7.1

CISCO-CLASS-BASED-QOS-MIB::cbQosCMName.1025 = STRING: class-default
CISCO-CLASS-BASED-QOS-MIB::cbQosCMName.1029 = STRING: ICMP
CISCO-CLASS-BASED-QOS-MIB::cbQosCMName.1057 = STRING: NonLocal
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDesc.1025 = STRING:
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDesc.1029 = STRING:
CISCO-CLASS-BASED-QOS-MIB::cbQosCMDesc.1057 = STRING:
CISCO-CLASS-BASED-QOS-MIB::cbQosCMInfo.1025 = INTEGER: matchAny(3)
CISCO-CLASS-BASED-QOS-MIB::cbQosCMInfo.1029 = INTEGER: matchAll(2)
CISCO-CLASS-BASED-QOS-MIB::cbQosCMInfo.1057 = INTEGER: matchAny(3)

We can easily get the class-map name:

# snmpget -v 2c -c public -m ALL 192.168.0.8 .1.3.6.1.4.1.9.9.166.1.7.1.1.1.1029

CISCO-CLASS-BASED-QOS-MIB::cbQosCMName.1029 = STRING: ICMP

Of course we can build NMS configuration including more details from both objects details and statistics.

Please note that, by default, indexes “are never reused between router reboots, even when changes are made to the QoS configuration“. This is stated in the CISCO-CLASS-BASED-QOS-MIB file. Fortunately, starting from 12.4(4)T, the cbqos keyword has been added to the snmp mib persist global command.

As said, as soon as possibile I’ll post a script to use Cisco CBQoS in Zabbix… stay tuned! πŸ˜‰

Some useful links:

The following two tabs change content below.
Italian, born in 1980, I started working in the IT/telecommunications industry in the late '90s; I'm now a system and network engineer with a deep knowledge of the global Internet and its core architectures, and a strong focus on network automation.

Latest posts by Pier Carlo Chiodi (see all)

24 Comments

  1. […] Routing Freak! « Cisco Class-Based QoS SNMP MIB and statistics monitor for NMS […]

  2. Marco Rizzi says:

    thanks a lot Pierky, very useful, i’m going to try it!

    For a Linux-dummy like me was more difficult to add the Cisco MIBS to my management station, in order to “resolve” MIB names…

    http://www.net-snmp.org/docs/FAQ.html#How_do_I_add_a_MIB_to_the_tools_

    solved this issue πŸ˜‰

  3. Akila says:

    Hi,

    Your post is very useful for me,thank u very much.And i’ve a question to u. Can a class have another class as its child ? From my observation class can have policy,matches and actions as its child. Is my observation right ? Plz clarify me soon….

    • pierky says:

      Hi Akila, thank you for you comment, you are right, you can have nested policies, even if I didn’t implement this feature in my Zabbix script!

      • Akila says:

        Hi Pierky,

        Still i’m not clear, let me explain my question clearly to you. Can a class have another class as its direct child ?

    • pierky says:

      As far as I know, a class-map cannot have another class-map as its child. Admittedly, I can’t figure out an application scenario. What you can do is a class-map matching another class-map:

      class-map match-any IPTraffic
      match protocol ip
      exit
      class-map match-all IPTrafficToWEBServer
      match class-map IPTraffic
      match access-group name MyWEBServer
      exit

      Maybe also we are speaking about the same thing! πŸ˜‰

      • Akila says:

        You are right Pierky, but i’ve configrure a sample nested policy in the router,while viewing the policy details with the help of MIB browsers, it shows a class has another class as its child… Thats why this confusion..
        Any way thanks for your quick reply ..

    • pierky says:

      Akila, could you post the nested policy config? I will try to investigate as soon as possible. Thank you

  4. tarun says:

    nice post … i like it very much

  5. Murilo says:

    I need to use CISCO-CLASS-BASED-QOS-MIB to monitor my QoS. How can I do to check QoS traffic of my class’s-map?

  6. Murilo says:

    My output is diferent your output. My output is diferent your output. How can I interpret my output?

    your: # snmpwalk -v 2c -c public -m ALL 192.168.0.8 .1.3.6.1.4.1.9.9.166.1.5.1
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1043 = Gauge32: 1035
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1045 = Gauge32: 1029
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1047 = Gauge32: 1033
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1049 = Gauge32: 1037
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1051 = Gauge32: 1025
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1053 = Gauge32: 1027
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1043.1085 = Gauge32: 1079
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1099 = Gauge32: 1063
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1101 = Gauge32: 1057
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1103 = Gauge32: 1061
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1105 = Gauge32: 1065
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1107 = Gauge32: 1025
    CISCO-CLASS-BASED-QOS-MIB::cbQosConfigIndex.1099.1109 = Gauge32: 1027
    CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1043 = INTEGER: policymap(1)
    CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1045 = INTEGER: classmap(2)
    CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1047 = INTEGER: matchStatement(3)
    CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1049 = INTEGER: queueing(4)
    CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1051 = INTEGER: classmap(2)
    CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1053 = INTEGER: matchStatement(3)
    CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1043.1085 = INTEGER: queueing(4)
    CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1099.1099 = INTEGER: policymap(1)
    CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType.1099.1101 = INTEGER: classmap(2)
    ……output ommited

    my: # snmpwalk -v 2c -c XXXXXX -m ALL xxx.xxx.xxx.xxx .1.3.6.1.4.1.9.9.166.1.5.1
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2145 = Gauge32: 1777
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2147 = Gauge32: 1695
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2151 = Gauge32: 1779
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2153 = Gauge32: 1683
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2157 = Gauge32: 1781
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2159 = Gauge32: 1671
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2163 = Gauge32: 1783
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2165 = Gauge32: 1737
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2169 = Gauge32: 1785
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2171 = Gauge32: 1713
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2175 = Gauge32: 1787
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2177 = Gauge32: 1725
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2181 = Gauge32: 1789
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2183 = Gauge32: 1743
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2187 = Gauge32: 1791
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2189 = Gauge32: 1677
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2193 = Gauge32: 1793
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2195 = Gauge32: 1689
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2199 = Gauge32: 1795
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2213 = Gauge32: 1053
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2219 = Gauge32: 1173
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2223 = Gauge32: 1803
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2231 = Gauge32: 1653
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2235 = Gauge32: 1807
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2243 = Gauge32: 1731
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2247 = Gauge32: 1811
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2249 = Gauge32: 1719
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2253 = Gauge32: 1813
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2261 = Gauge32: 1749
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2265 = Gauge32: 1817
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2267 = Gauge32: 1485
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2271 = Gauge32: 1819
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2273 = Gauge32: 1407
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2277 = Gauge32: 1821
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2279 = Gauge32: 1539
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2283 = Gauge32: 1823
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2285 = Gauge32: 1587
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2289 = Gauge32: 1825
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2291 = Gauge32: 1563
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2295 = Gauge32: 1827
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2297 = Gauge32: 1623
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2301 = Gauge32: 1829
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2303 = Gauge32: 1605
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2307 = Gauge32: 1831
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2309 = Gauge32: 1659
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2313 = Gauge32: 1833
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2315 = Gauge32: 1611
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2319 = Gauge32: 1835
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2321 = Gauge32: 1629
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2325 = Gauge32: 1837
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2327 = Gauge32: 1569
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2331 = Gauge32: 1839
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2333 = Gauge32: 1593
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2337 = Gauge32: 1841
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2339 = Gauge32: 1545
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2343 = Gauge32: 1843
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2345 = Gauge32: 1551
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2349 = Gauge32: 1845
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2351 = Gauge32: 1515
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2355 = Gauge32: 1847
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2357 = Gauge32: 1521
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2361 = Gauge32: 1849
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2363 = Gauge32: 1509
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2367 = Gauge32: 1851
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2369 = Gauge32: 1473
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2373 = Gauge32: 1853
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2375 = Gauge32: 1491
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2379 = Gauge32: 1855
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2381 = Gauge32: 1461
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2385 = Gauge32: 1857
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2387 = Gauge32: 1467
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2391 = Gauge32: 1859
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2393 = Gauge32: 1449
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2397 = Gauge32: 1861
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2399 = Gauge32: 1455
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2403 = Gauge32: 1863
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2405 = Gauge32: 1425
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2409 = Gauge32: 1865
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2411 = Gauge32: 1767
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2415 = Gauge32: 1867
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2417 = Gauge32: 1761
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2421 = Gauge32: 1869
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2423 = Gauge32: 1635
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2427 = Gauge32: 1871
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2429 = Gauge32: 1527
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2433 = Gauge32: 1873
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2435 = Gauge32: 1575
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2439 = Gauge32: 1875
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2441 = Gauge32: 1647
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2445 = Gauge32: 1877
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2447 = Gauge32: 1641
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2451 = Gauge32: 1879
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2453 = Gauge32: 1617
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2457 = Gauge32: 1881
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2459 = Gauge32: 1581
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2463 = Gauge32: 1883
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2465 = Gauge32: 1755
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2469 = Gauge32: 1885
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2471 = Gauge32: 1665
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2475 = Gauge32: 1887
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2477 = Gauge32: 1431
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2481 = Gauge32: 1889
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2483 = Gauge32: 1419
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2487 = Gauge32: 1891
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2489 = Gauge32: 1479
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2493 = Gauge32: 1893
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2495 = Gauge32: 1497
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2499 = Gauge32: 1895
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2501 = Gauge32: 1025
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.2503 = Gauge32: 1027
    SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.2145.3489 = Gauge32: 1717
    …output ommited

    • pierky says:

      I need to use CISCO-CLASS-BASED-QOS-MIB to monitor my QoS. How can I do to check QoS traffic of my class’s-map?
      My output is diferent your output. My output is diferent your output. How can I interpret my output?

      Hi, I think in my post I wrote how to interpret your output.

      The layout of your output is different because you don’t have the CISCO-CLASS-BASED-QOS-MIB definition file on the computer where you ran the snmpwalk command; you can find it here http://bit.ly/fnoV22 and you have to put it in the SNMP library, with its dependencies too. Anyway, this only impacts the way the output is shown: CISCO-CLASS-BASED-QOS-MIB::cbQosObjectsType is equivalent to SNMPv2-SMI::enterprises.9.9.166.1.5.1.1.2.

      Indexes (1043.1043, 1043.1045 and so on in my output, 2145.2145, 2145.2147 in your) depend on the specific configuration and internal objects numbering.

  7. Murilo says:

    can you help to install this MIB? which directory should I install?
    I use CENTOS SERVER (red hat 5.0)

    thanks

  8. Vo Minh Thuan says:

    Hi all,

    I have just apply policer on my 7609 router, i would like to monitor traffic on each class of service. And this here is show policy-map output on my router:

    Service-policy output: ABC

    class-map: Hosting-Colocation-to-Network (match-any)
    Match: access-group name Hosting-Colocation-to-VN2
    police :
    10000000000 bps 31250000 limit 31250000 extended limit
    Earl in slot 4 :
    13801619258245 bytes
    30 second offered rate 144487304 bps
    aggregate-forwarded 13801619258245 bytes action: transmit
    exceeded 0 bytes action: transmit
    aggregate-forward 145773304 bps exceed 0 bps
    Earl in slot 5 :
    72837 bytes
    30 second offered rate 0 bps
    aggregate-forwarded 72837 bytes action: transmit
    exceeded 0 bytes action: transmit
    aggregate-forward 0 bps exceed 0 bps

    class-map: class-default (match-any)
    Match: any
    police :
    10000000000 bps 31250000 limit 31250000 extended limit
    Earl in slot 4 :
    74520070218188 bytes
    30 second offered rate 879718984 bps
    aggregate-forwarded 74520070218188 bytes action: transmit
    exceeded 0 bytes action: transmit
    aggregate-forward 888842536 bps exceed 0 bps
    Earl in slot 5 :
    5622549680569 bytes
    30 second offered rate 93300336 bps
    aggregate-forwarded 5622549680569 bytes action: transmit
    exceeded 0 bytes action: transmit
    aggregate-forward 99314912 bps exceed 0 bps

    Pls advise how to get OID or how to grahp them.

    Best regards,
    Vo Minh Thuan

  9. Phil says:

    Hi.
    Do you if it is possible to get the access-list via SNMP!?
    Thanks

  10. Hi,

    I’m developing a QoS parser for another NMS, and I’m having a strange issue with Cisco ASR platforms, where my top-level service policies don’t have the same value for cbQosPolicyIndex and cbQosObjectsIndex.

    The cbQosPolicyIndex is nicely matching its sibling in cbQosServicePolicyTable, but the cbQosObjectsIndex is coming out of nowhere, so I can’t use twice the same value to find the matching cbQosConfigIndex within cbQosObjectsTable.

    Have you seen this issue already (especially with ASR), and how do you solve it ?

    TIA,
    Charles

  11. Holman Avila says:

    How can I obtain the QoS OID from my Cisco Router?

  12. atul says:

    Hi Pierky
    Thanks thats great document . Had a query :
    if i only apply Police command under class map on interface . Will this class map drop stats(cbQosClassMapStats ) show me dropped packets dropped by Police command too or its just for Drop in queues by bandwidth command . Why i am asking that is because dropped packet amount when policy command applied doesnt match cbQosClassMapStats in my case .

    cbQosClassMapStats (1.3.6.1.4.1.9.9.166.1.15)
    +– -R– Counter cbQosCMDropPkt(13)
    +– -R– Counter64 cbQosCMDropPkt64(14)

Leave a Reply