Building network automation solutions

9 module online course

Start now!

The most convoluted MIB I’ve seen

Jared Valentine sent me a really interesting problem: he would like to detect voice traffic and start shaping TCP traffic for the duration of the voice call. The ideal solution would be an EEM applet reacting to the changes in the CISCO-CLASS-BASED-QOS-MIB; one of its tables contains the amount of traffic for each class configured in a service policy.

The MIB navigation looks simple: you just read the values from the cbQosClassMapStats table, indexed by policy ID and class ID. The real problem is finding the correct index values. I could walk the MIB manually with a MIB browser or snmp_getnext TCL calls, but this approach is obviously not scalable, so I wrote a script that walks through the cbQosServicePolicy, cbQosObjects, cbQosPolicyMapCfg and cbQosClassMapCfg tables and prints the index values you need.

You can find more Tcl-related information in the Tclsh on Cisco IOS tutorial. Sample Tclsh scripts are available in the Tclsh script library. If you need expert help in planning, developing or deploying Tclsh scripts in your network, contact the author.


  1. This has got to be the most perfect example problem that would allow me to tie together a bunch of things that I have been wanting to do for a very long time ... Ivan, is there any way that you can post this solution including the EEM script and configuration; I think this could be an invaluable learning example for a lot of us who are still trying to connect the TCL/EEM dots in our Cisco configurations.
  2. Will do ... probably not earlier than next year. I just need "a little bit" of time :)
  3. I tried the script and find some incompatibility with Cisco ASR 1002 with IOS 12.2(33)XNC2.
    Following TCL command
    snmp_getnext public "cbQosObjectsType"
    is answered with next message:
    'Could not translate object: cbQosObjectsType into an oid.'
    Should I use format like for oid parameter?
Add comment