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.

3 comments:

  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.

    ReplyDelete
  2. Will do ... probably not earlier than next year. I just need "a little bit" of time :)

    ReplyDelete
  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 1.3.6.1.4.1.9.9.166.1.1.1.1.4 for oid parameter?

    ReplyDelete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.