[SNMP] Templates for graphing Cisco CBWFQ Policy

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

hmorandell
Cacti User
Posts: 73
Joined: Mon May 03, 2010 11:48 am

[SNMP] Templates for graphing Cisco CBWFQ Policy

Post by hmorandell »

Hello,

after long time looking on the forum finding no really usable (at least for me) scripts and templates, I decided to create one on my own.

This script will graph QOS Policy's (CBWFQ) using SNMP queries only, so it is lightening fast using no script or script server. The results for me are very good, a disadvantage is that it is not easy to set it up, but once you have done it it should be pretty straight forward for everyone.

results you may get look like the following (and best is if there are no drops :) ):
Image
Image
Image

Here are the instructions to use this scripts. Please read the whole thread and do all steps before asking questions!
1. Preliminary steps necessary on the device where you have QOS configured (Cisco):
  • 1. We need static SNMP indexes, therefore issue the following commands in cli mode:

    Code: Select all

    snmp-server ifindex persist
    snmp mib persist cbqos
    
    2. I use the fantastic script from http://www.nil.com to map policy index and class index values. Download it from here: http://wiki.nil.com/Class-based_QoS_MIB_indexes
    3. Copy the script to your Cisco using tftp and place it in the flash memory. Then issue the following command in config mode:

    Code: Select all

    alias exec cbindex tclsh flash:cbindex.tcl

    4. Now issue the command

    Code: Select all

    cbindex communityname
    (where communityname is the name of your snmp community) and you should see something like this:

    Code: Select all

    Vlan1 (in): PM_MARK_BALANCED_IN (144)
      CL_MARK_PRIORITY 144.3242849
      class-default 144.8167457
      CL_MARK_GOLD 144.12590929
      CL_MARK_SILVER 144.15398929
      CL_MARK_SCAVANGER 144.15591361
    
    ATM0.100-aal5 layer (out): PM_BALANCED_OUT (274)
      CL_SILVER_CS3 274.8142657
      class-default 274.9412641
      CL_SCAVANGER_CS1 274.9587217
      CL_MGM_CS6 274.11786929
      CL_PRIORITY_CS5 274.15543217
      CL_GOLD_CS4 274.15882177
    
5. If you have not done already, save you configuration
OK. Your device has now static SNMP indexes which never changes even after a reload! Now you are ready to graph the policies in your cacti installation.
1. Copy "myQOS.xml" to <path to cacti>/resource/snmp_queries/myQOS.xml
2. Import the attached templates in your cacti installation:

Code: Select all

cacti_data_query_my_qos_bitrate.xml
cacti_data_template_cisco_-_my_qos_bitrate.xml
cacti_graph_template_cisco_-_my_qos_bitrate.xml
3. Once done, go to your device and add the following data query: "MY QOS BITRATE"
4. OK, now we get to the tricky part: remember the mapping of policy name with snmp index we mentioned before? OK now we need it. When you go to "Create Graphs for this Host" you should see something like that:
Image

There is no name of the class which the snmp query does return so we have to make the mapping by hand. Sorry I now this is not very nice, but the only way to make it work (at least the only one I found).
5. So based on your mapping, select the index you want to monitor and create the graph. You will be taken to the next screen where you can set the title of your graph and the name of your datasource (I always give both the same name), put in something useful for you (e.g. |host_description| policy name - class name)
Then wait for the magic to start happen....

I hope this might be useful to anyone, instead of the other templates using php or perl calls this script uses only SNMP queries and therefore it is very fast, but it has the disadvantage that it is fairly complicated to set up. But once it is up and running it is very very useful (at least I found it so, it helped a lot to understand my traffic usage).



If there is anyone who can help improve this script, please let me know. Any feedback is welcome.
Attachments
Cisco_CBWFQ_monitoring.zip
(3.95 KiB) Downloaded 1238 times
_________________
Cacti - 1.2.14
Poller Type - SPINE 1.2.14
Devices 3,892
Graphs 21,483
billwong
Posts: 1
Joined: Sat Oct 02, 2010 1:45 am

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by billwong »

hi,

when i imported your templates i got problems - Unmet Dependency.
Below is the error of one of the template you provided.
my cacti is - Version 0.8.7g

Cacti has imported the following items:

Data Query

[success] MY QOS BITRATE [update]
+ Unmet Dependency: (Data Input Method) Get SNMP Data (Indexed)
+ Unmet Dependency: (Graph Template) Cisco - My QOS Bitrate
+ Unmet Dependency: (Data Template) Cisco - My QOS Bitrate
+ Unmet Dependency: (Data Template Item) qosBitrate
+ Unmet Dependency: (Data Template Item) qosPreBitrate
+ Unmet Dependency: (Data Template Item) qosDroprate
dengi
Posts: 5
Joined: Tue Feb 03, 2009 9:53 pm

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by dengi »

Hello hmorandell

Thanks for your templates and script! But does the 'cbindex' script must work with 'snmp mib persist cbqos' command? In my test, this command found in IOS of T version only. I cann't find the command in other IOS version.

C3845#sh ver
Cisco IOS Software, 3800 Software (C3845-ADVENTERPRISEK9-M), Version 12.4(25e), RELEASE SOFTWARE (fc2)
C3845(config)#snmp mib persist ?
circuit Circuit MIB persistence
event event MIB persistence
expression expression MIB persistence
<cr>

How can I let the template working for my router?
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by jay »

Hi

The command you entered is incorrect hence why you get the error
its snmp-server as shown below

snmp-server ifindex persist

If only we managed our own routers on our WAN I could use this. Unfortunately I'm stuck with the slow PHP script version which causes gaps in my graphs *SIGH*

Cheers
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
rmcdonald
Posts: 42
Joined: Wed Dec 22, 2010 4:03 pm
Location: Minnesota

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by rmcdonald »

Question

Will these templates support nested policies? The one I am currently using does not support having a nested policy on a for example mulitlink interface.

Thanks
liusc
Posts: 13
Joined: Wed Oct 19, 2011 7:56 pm

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by liusc »

Nice script..
could you attach the script for cacti 0.8.7g??
liusc
Posts: 13
Joined: Wed Oct 19, 2011 7:56 pm

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by liusc »

hi billwong,
i face the same problem.do you solve it?
billwong wrote:hi,

when i imported your templates i got problems - Unmet Dependency.
Below is the error of one of the template you provided.
my cacti is - Version 0.8.7g

Cacti has imported the following items:

Data Query

[success] MY QOS BITRATE [update]
+ Unmet Dependency: (Data Input Method) Get SNMP Data (Indexed)
+ Unmet Dependency: (Graph Template) Cisco - My QOS Bitrate
+ Unmet Dependency: (Data Template) Cisco - My QOS Bitrate
+ Unmet Dependency: (Data Template Item) qosBitrate
+ Unmet Dependency: (Data Template Item) qosPreBitrate
+ Unmet Dependency: (Data Template Item) qosDroprate
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by TheWitness »

The original author needs to do the following:

Code: Select all

php -q repair_database.php
Repair the problems, then re-export the template for your consumption.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
proohu01
Posts: 45
Joined: Mon Dec 20, 2004 3:13 am
Location: The Netherlands

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by proohu01 »

Hello hmorandell,

Could you please do a repair and re-export as TheWitness suggested? It would be really great for all of us!

Thank you.
Cacti Version - 0.8.8b
CentOS 6.4
hmorandell
Cacti User
Posts: 73
Joined: Mon May 03, 2010 11:48 am

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by hmorandell »

Hi,

by issueing the following command:

Code: Select all

php -q repair_database.php
I receive the following error:
NOTE: Checking for Invalid Cacti Templates
NOTE: 1 Invalid CDEF Item Rows Found in Graph Templates

WARNING: Serious Cacti Template Problems found in your Database. Using the '--force' option will remove
the invalid records. However, these changes can be catastrophic to existing data sources. Therefore, you
should contact your support organization prior to proceeding with that repair.

Anyway I did a new export of the script, can someone tell me if this works?
Attachments
Cisco My QOS.zip
(9.29 KiB) Downloaded 870 times
_________________
Cacti - 1.2.14
Poller Type - SPINE 1.2.14
Devices 3,892
Graphs 21,483
User avatar
proohu01
Posts: 45
Joined: Mon Dec 20, 2004 3:13 am
Location: The Netherlands

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by proohu01 »

It sure did! The import went just fine.

Thanks for the quick reply. I am going to setup the rest and test it.
Cacti Version - 0.8.8b
CentOS 6.4
liusc
Posts: 13
Joined: Wed Oct 19, 2011 7:56 pm

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by liusc »

[quote="hmorandell"]Hi,

I do import the xmls, error:invalid hash.
I change the hash using the old attachment of yours, & import successful.

Add the MY QOS BITRATE to device, all debug ok but graph debug:

RRDTool Says:
ERROR: opening '/var/www/html/cacti/rra/******_qosbitrate_2723.rrd': No such file or directory

No graph created & other working data queries also giving same error on device that have added qos bitrate query.


PA:2.9
Cacti:0.8.7g
liusc
Posts: 13
Joined: Wed Oct 19, 2011 7:56 pm

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by liusc »

proohu01 wrote:Is yours running fine.
liusc
Posts: 13
Joined: Wed Oct 19, 2011 7:56 pm

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by liusc »

hi proohu01,
Are you tested?graph ok?
proohu01 wrote:It sure did! The import went just fine.

Thanks for the quick reply. I am going to setup the rest and test it.
User avatar
proohu01
Posts: 45
Joined: Mon Dec 20, 2004 3:13 am
Location: The Netherlands

Re: [SNMP] Templates for graphing Cisco CBWFQ Policy

Post by proohu01 »

Yep. I am getting nice graphs.
QoS.gif
QoS.gif (46.94 KiB) Viewed 14006 times
Cacti Version - 0.8.8b
CentOS 6.4
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests