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 ):
Here are the instructions to use this scripts. Please read the whole thread and do all steps before asking questions!
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. Preliminary steps necessary on the device where you have QOS configured (Cisco):5. If you have not done already, save you configuration
- 1. We need static SNMP indexes, therefore issue the following commands in cli mode:
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_indexesCode: Select all
snmp-server ifindex persist snmp mib persist cbqos
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(where communityname is the name of your snmp community) and you should see something like this:Code: Select all
cbindex communityname
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
Then wait for the magic to start happen....1. Copy "myQOS.xml" to <path to cacti>/resource/snmp_queries/myQOS.xml
2. Import the attached templates in your cacti installation:3. Once done, go to your device and add the following data query: "MY QOS BITRATE"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
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:
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)
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.