Cisco Router - Class Map statistics

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

Moderators: Moderators, Developers

Author
Message
User avatar
Instigater
Cacti User
Posts: 141
Joined: Mon Dec 13, 2004 5:14 pm
Location: Jurmala, Latvia

Cisco Router - Class Map statistics

#1 Post by Instigater » Thu Nov 16, 2006 5:41 am

One day I noticed Cisco CBWFQ template, it had one major problem - it did not take in account the direction of policy and showed only one direction (and you could only guess which it was). I modified script from that tamplate to fix this issue.
I won't publish complete template is not usable on standard cacti, just data query and perl script, you should be fine to make further it out. I'm using 1 minute polling interval on my system.

Put qos.xml in resource/script_queries folder and qospol.pl in scripts folder.
Attachments
CM_stats.tar.gz
Script and XML file
(2.44 KiB) Downloaded 5277 times
cacti_data_query_cisco_router_cm_stats.xml.tar.gz
Data query and graph template. For testing purposes only!
(4.24 KiB) Downloaded 5423 times
teaser01.jpg
teaser01.jpg (30.77 KiB) Viewed 64294 times
teaser02.jpg
teaser02.jpg (62.09 KiB) Viewed 64294 times

Shuyun
Posts: 5
Joined: Thu Dec 28, 2006 3:48 pm
Location: Dalla, TX

nan graphs

#2 Post by Shuyun » Thu Jan 04, 2007 12:38 pm

Instigater

Thanks for the CBWFQ template. I am having a problem where it looks like everything is installed correctly but my graphs are just showing "nan". If I run snmpwalk I can see that all of the needed OID's are there but I am collecting any data. Any thoughts?

Thanks,
Shuyun

PS. To add to this I have tried running the script from the command line...

./qospol.pl somerouterip somecommunity 2 get QoSbitrate 22

and this is what I get...

Use of uninitialized value in string eq at ./qospol.pl line 257.
Use of uninitialized value in string eq at ./qospol.pl line 257.
Use of uninitialized value in string eq at ./qospol.pl line 257.
this

Not sure if this is the right way to enter it from the command line.

Thanks,
Shuyun

mauri
Posts: 3
Joined: Wed Jan 24, 2007 11:18 am

CBWFQ

#3 Post by mauri » Wed Feb 14, 2007 3:52 pm

Excellent Template/Script!!
The only problem is that with some routers it takes more than 5 minutes to discover. Is there any way could add a cache option and re-discover only when needed?
Thanks.

adam-trd
Posts: 15
Joined: Tue Jan 17, 2006 11:24 pm

#4 Post by adam-trd » Mon Mar 12, 2007 8:05 pm

any update on this?

i my graphs display "nan"

adam-trd
Posts: 15
Joined: Tue Jan 17, 2006 11:24 pm

#5 Post by adam-trd » Mon Mar 12, 2007 10:35 pm

i ended up using "moonshines" script

NoisyOcean
Posts: 2
Joined: Wed May 24, 2006 8:00 am

Re: Cisco Router - Class Map statistics

#6 Post by NoisyOcean » Tue Mar 13, 2007 5:04 am

which version of Perl or.. which packages of Perl must be installed..?
When I load this script, it doens't return any values..

eddievenus
Cacti User
Posts: 60
Joined: Mon Jul 18, 2005 7:01 pm

#7 Post by eddievenus » Fri Sep 28, 2007 3:21 pm

I too only get Nan for my graphs and also get uninitialized values when I try to run it from the command line. I am hoping someone here knows why this is happening. If anyone has this working or if anyone knows why this is being problematic please let us know.

I had used other cbwfq graphs before and this one looks like the most progressive and certainly the best looking. I am hoping to make this work but I know nothing of PERL or PHP so this may be slow going. If anyone knows what might be wrong i would be happy to help test your theories.

thanks

leonardo_gyn
Cacti User
Posts: 82
Joined: Sat Jan 22, 2005 4:51 pm

#8 Post by leonardo_gyn » Mon Nov 19, 2007 5:25 am

I'm also experiencing the error

Use of uninitialized value in concatenation

Watching the errors and qospol.pl file, seems that ALL errors are regarding the lines that print the variable index value number 18, just like:

print $cbitr[18] . "\n";

print $precbitr[18] . "\n";

print $dropbitr[18] . "\n";

This command, printing the variable index number 18, happens several times on qospol.pl and seems it's the one that is generating the error.

I can successfully do the snmpwalk commands and can see values .... but nothing is returned from the qospol.pl script but the 'unitialized value in concatenation' ....

dswinford
Posts: 10
Joined: Fri Nov 09, 2007 3:54 pm

#9 Post by dswinford » Fri Feb 15, 2008 3:32 pm

Has anyone been able to de-linux a CBWFQ script? I am attempting to find a CBWFQ data source for a Windows based CACTI system.

B-rad
Posts: 5
Joined: Fri Feb 15, 2008 7:29 pm

#10 Post by B-rad » Fri Feb 15, 2008 7:31 pm

dswinford wrote:Has anyone been able to de-linux a CBWFQ script? I am attempting to find a CBWFQ data source for a Windows based CACTI system.
I got moonmans script working last night on W2k3, you just need to move $node around in the perl file.

Vade
Posts: 1
Joined: Thu Apr 03, 2008 6:12 am

#11 Post by Vade » Thu Apr 03, 2008 6:25 am

leonardo_gyn wrote:I'm also experiencing the error

Use of uninitialized value in concatenation

Watching the errors and qospol.pl file, seems that ALL errors are regarding the lines that print the variable index value number 18, just like:

print $cbitr[18] . "\n";

print $precbitr[18] . "\n";

print $dropbitr[18] . "\n";

This command, printing the variable index number 18, happens several times on qospol.pl and seems it's the one that is generating the error.

I can successfully do the snmpwalk commands and can see values .... but nothing is returned from the qospol.pl script but the 'unitialized value in concatenation' ....
I know this is an old post, but I also had this problem - fixed it by replacing [18] with [13].

explanation: if you have a look at the output of your snmpwalk, you'll see it looks like:

[email protected]:~# /usr/local/bin/snmpget -Os -c <your comm string> -v 2c <your ip> 1.3.6.1.4.1.9.9.166.1.15.1.1.11.691199.691201
enterprises.9.9.166.1.15.1.1.11.691199.691201 = Gauge32: 7340000

after the snmp command is run in the qospol.pl script, you'll see it performs a "=~ s/ /./g", which means substitute spaces with periods ( . ). There are only 3 spaces in the output of the snmpget command - before and after the "=" and after the "Gauge32:". The resulting string is then:

enterprises.9.9.166.1.15.1.1.11.691199.691201.=.Gauge32:.7340000

so then it considers periods ( . ) as deliminators, and [18] means print the 18th field, which clearly doesn't exist (hence the NaN). Counting the fields (inbetween periods ) in the above string shows that the value you are after is actually field 13

hope it helps! it did for me!

msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

#12 Post by msw1970 » Mon Apr 07, 2008 9:00 am

Great script....

However, I have a problem where I need to graph approximately 5 QoS classes in each direction on somewhere around 50 routers. Along with the rest of the polling, if I add all of that in then I can't hit the 300 second limit even though I'm using spine and boost....

Does anyone know if this would work quicker if converted to php to run through the script server??

praveen_b744
Posts: 14
Joined: Tue May 27, 2008 2:45 am

#13 Post by praveen_b744 » Tue Aug 05, 2008 4:07 am

Hi Instigater,

I am trying to run the script from the command line.But its giving the following error.

# perl qospol.pl
not enough or wrong arguments

And I came to know that the syntax is
./qospol.pl somerouterip somecommunity 2 get QoSbitrate 22

Can you please explain how to use that script.

Or can you please tel me how to setup this template?

HerzogEH
Posts: 5
Joined: Tue Jan 22, 2008 4:04 pm

Updated Version of qospol.pl

#14 Post by HerzogEH » Wed Sep 03, 2008 3:22 pm

Hello,

I have updated the qospol.pl - script, so that it work correctly with snmp output like this:

enterprises.9.9.166.1.15.1.1.10.34.7611937 = Counter64: 170243

best regards,

Erwin Herzog
Attachments
qospol.pl
(7.06 KiB) Downloaded 3299 times

HerzogEH
Posts: 5
Joined: Tue Jan 22, 2008 4:04 pm

Cisco Router - Class Map statistics Update 2

#15 Post by HerzogEH » Wed Sep 03, 2008 5:08 pm

Hello once again,

Here is the next update.

At this Version you can modify the path where your SNMPWalk and SNMPGet is located.

and it is SNMP Version 1 & 2 compatible.
(Don´t forget, only the Bitrate - Counters are Version 1 compatilbe not the 64 Bit counters.)

I have also added support for cbQosCMPostPolicyByteOverflow and cbQosCMPrePolicyByteOverflow counters.

best regards

Erwin Herzog
Attachments
qospol.pl
(8.28 KiB) Downloaded 4264 times
qos.xml
(3.32 KiB) Downloaded 4596 times

Post Reply