Cisco Router - Class Map statistics

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

Moderators: Moderators, Developers

Author
Message
Jesper
Posts: 45
Joined: Mon Mar 11, 2002 7:00 pm

Re: Cisco Router - Class Map statistics

#31 Post by Jesper » Sun Jan 09, 2011 6:25 am

Greetings,

Does someone have an export from 0.8.7g available that could be attached...? I'm getting XML Parse error when trying to import the cacti_data_query_cisco_router_-_cm_stats.xml file.

Thank you,
/Jesper

User avatar
mschwen
Posts: 17
Joined: Thu Nov 06, 2008 1:03 pm
Location: Orem, Utah

Re: Cisco Router - Class Map statistics

#32 Post by mschwen » Wed Jan 12, 2011 6:36 pm

Hey Guys, I wonder if any of you still hang around here? I just 1 thing I am trying to figure out with this. I am pulling QOS info from a number of routers, my pre-class and post-class look fine. But my drop rate always stays at 0 even though I know its not. Any ideas?
Attachments
screen-capture-8.png
screen-capture-8.png (33.44 KiB) Viewed 5442 times
“Sometimes the questions are complicated and the answers are simple.” - Dr. Suess

- Matthew Schwen
Network Engineer
Adobe Systems

toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Cisco Router - Class Map statistics

#33 Post by toe_cutter » Sat Jan 15, 2011 8:15 am

mschwen wrote:Hey Guys, I wonder if any of you still hang around here? I just 1 thing I am trying to figure out with this. I am pulling QOS info from a number of routers, my pre-class and post-class look fine. But my drop rate always stays at 0 even though I know its not. Any ideas?
I have to check at work on monday, but what if you snmpwalk the droprate-oid and see what you get? It could also be that the oid has changed, i sortof remember something about that, but again, i have to check at work.

bidzer
Posts: 30
Joined: Tue Jun 20, 2006 12:49 pm

Re: Cisco Router - Class Map statistics

#34 Post by bidzer » Mon Jan 24, 2011 9:12 am

What version is this export for? Anyone have one for 0.8.7c? Very nice work on this.

Thanks,
Bidzer

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

Re: Cisco Router - Class Map statistics

#35 Post by hmorandell » Sat Feb 19, 2011 2:56 pm

Hello,

I hav einstalled the php version of the script. I'm running about 100 routers with differnt QOS Policy Maps configured, so I activated the CM data query on them and got about 1000 more data sources and lot of new rrd files.

Afterwards I got lots of similar error messages in my logfile:
Poller[0] ERROR: SS[0] PHP Script Server communications lost. Restarting PHP Script Server
[0] ERROR: Input Expected, Script Server Terminating
and the overall php script server increased drammatically as you can see here:
poller_items.png
poller_items.png (18.78 KiB) Viewed 5349 times
and here the object image:
poller_objects.png
poller_objects.png (22.19 KiB) Viewed 5349 times
afterwards I have deleted on some hosts the data query as I got loads of before declared errors, also the overall query time increased as you can see here:
runtime.png
runtime.png (22.1 KiB) Viewed 5349 times
Question:
1. Why do I have so much more SCRIPT SERVER now?
2. Why is the overall stats time so much increased?
3. Is there a chance to optimize things for me or does someone know a better script to graph Cisco CBWFQ?

this is my cacti instance technical info:
Technical Support
General Information
Date Sat, 19 Feb 2011 20:56:25 +0100
Cacti Version 0.8.7g
Cacti OS unix
SNMP Version NET-SNMP version: 5.4.2.1
RRDTool Version RRDTool 1.3.x
Hosts 718
Graphs 2137
Data Sources : 1
Script/Command: 112
SNMP: 27
SNMP Query: 1768
Script Query: 24
Script - Script Server (PHP): 4
Script Query - Script Server: 202
Total: 2138
Poller Information
Interval 60
Type spine
Items Action[0]: 3433
Action[1]: 112
Action[2]: 607
Total: 4152
Concurrent Processes 1
Max Threads 50
PHP Servers 7
Script Timeout 25
Max OID 10
Thanks for any help!
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1

toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Cisco Router - Class Map statistics

#36 Post by toe_cutter » Sat Feb 19, 2011 3:37 pm

hmorandell wrote:I hav einstalled the php version of the script. I'm running about 100 routers with differnt QOS Policy Maps configured, so I activated the CM data query on them and got about 1000 more data sources and lot of new rrd files.

Question:
1. Why do I have so much more SCRIPT SERVER now?
2. Why is the overall stats time so much increased?
3. Is there a chance to optimize things for me or does someone know a better script to graph Cisco CBWFQ?
1. Since you created cbwfq-graphs for all your hosts, and, i assume for all your policy-maps. These data sources uses the script server, and thus your script server objects increase.
2. The script has to be called once for every data source. And script server is the fastest there is next to regular snmp, but still alot slower. This is only logical, you add a bunch of script-server data sources to be run, the poll takes longer.
3. Im sure there is room for optimizations of the script, but i dont have the time currently to look over it.

A tip is to not create cbwfq graphs for every host/policy-map, but to use it on important devices, or as a faultsearching tool.

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

Re: Cisco Router - Class Map statistics

#37 Post by hmorandell » Sun Feb 20, 2011 4:45 am

toe_cutter wrote:
hmorandell wrote:I hav einstalled the php version of the script. I'm running about 100 routers with differnt QOS Policy Maps configured, so I activated the CM data query on them and got about 1000 more data sources and lot of new rrd files.

Question:
1. Why do I have so much more SCRIPT SERVER now?
2. Why is the overall stats time so much increased?
3. Is there a chance to optimize things for me or does someone know a better script to graph Cisco CBWFQ?
1. Since you created cbwfq-graphs for all your hosts, and, i assume for all your policy-maps. These data sources uses the script server, and thus your script server objects increase.
2. The script has to be called once for every data source. And script server is the fastest there is next to regular snmp, but still alot slower. This is only logical, you add a bunch of script-server data sources to be run, the poll takes longer.
3. Im sure there is room for optimizations of the script, but i dont have the time currently to look over it.

A tip is to not create cbwfq graphs for every host/policy-map, but to use it on important devices, or as a faultsearching tool.
thx for your quick response. I understand that it should be possible moving the script to snmp queries instead of using the php file? Will this be hard to realize, do you recommend using your 3 files as a starting point or starting from something else?
Is there any easy way to do this, or do you think this will only take to much time?

I really like the graphs your script creates, the most i need to know is if I have drops on some of my classes!

Thx for this great share!
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1

toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Cisco Router - Class Map statistics

#38 Post by toe_cutter » Sun Feb 20, 2011 6:21 am

hmorandell wrote:thx for your quick response. I understand that it should be possible moving the script to snmp queries instead of using the php file? Will this be hard to realize, do you recommend using your 3 files as a starting point or starting from something else?
Is there any easy way to do this, or do you think this will only take to much time?

I really like the graphs your script creates, the most i need to know is if I have drops on some of my classes!

Thx for this great share!
If it were possible to do this via regular snmp queries (indexed) it would probably have been done already, ill have another look at it during next week tho.
What you can do, since you only need drops is to edit the data template and graph template to only include the drops. You might have to edit the data query aswell. This will cut down the amount of data sources that is run.

:) your welcome

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

Re: Cisco Router - Class Map statistics

#39 Post by hmorandell » Sun Feb 20, 2011 10:56 am

@toe_cutter: do you think that there will be no chance to use snmp queries instead of php script server? What could be the problem? Is it not only a similar query then using the standard interface snmp query?

I really appreciate your work.
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1

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

Re: Cisco Router - Class Map statistics

#40 Post by hmorandell » Mon Feb 21, 2011 5:56 am

Sorry to say that,

but this is pretty useless: as soon as there is lots of traffic on the routers and the different QOS classes, the script keeps going in timeout and all the cacti spine processes go in blocking so that on all graphs you get data losses.

I had to reduce this script now to 3 routers and suggest to everyone to use it only for debbuging purposes only and not for daily use!
_________________
Cacti - 0.8.8c
Poller Type - SPINE 0.8.7i
Server Info - Linux 2.6.31.14 - Opensuse 11
Web Server - Apache/2.2.13 PHP 5.3.3
MySQL - 5.1.49 ;RRDTool - 1.3.7 ;SNMP - 5.4.2.1

sledge121
Posts: 2
Joined: Sat Oct 15, 2011 3:02 am

Re:

#41 Post by sledge121 » Sat Oct 15, 2011 9:04 am

Vade wrote:
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!



This worked for me but with a different value so it is the fix for -nan values, you will need to work out what number works for you with snmpwalk, mine was 11

linvinus
Posts: 2
Joined: Thu Feb 09, 2012 5:34 am

Re:

#42 Post by linvinus » Thu Feb 09, 2012 6:22 am

toe_cutter wrote:Hi all!

I just finished converting (and testing) HerzogEH's perl-script to Cacti PHP Script Server.
I had to create a new data and graph template for it with new DS-names. But i only created for my needs (pre/post/drop bitrate (64bit)). So thats all im including.

Oh, its SNMPv3 compatible too.

Fields polled by script:

Code: Select all

qosbitrate (32bit)			  	=> .1.3.6.1.4.1.9.9.166.1.15.1.1.11
qosprebitrate (32bit)		  	=> .1.3.6.1.4.1.9.9.166.1.15.1.1.7
qosdropbitrate (32bit)		 	=> .1.3.6.1.4.1.9.9.166.1.15.1.1.18
qosdropbyte (64bit)		    	=> .1.3.6.1.4.1.9.9.166.1.15.1.1.17
qosprebyte (64bit)		  		=> .1.3.6.1.4.1.9.9.166.1.15.1.1.6
qosbyte (64bit)			     	=> .1.3.6.1.4.1.9.9.166.1.15.1.1.10
qosoverflowbyte (32bit)			=> .1.3.6.1.4.1.9.9.166.1.15.1.1.8
qospreoverflowbyte (32bit)		=> .1.3.6.1.4.1.9.9.166.1.15.1.1.4
Some stats:

Code: Select all

[[email protected] /usr/local/share/cacti/scripts]# time php -q ss_qospol.php <host> "" 2:161:500:3:20:<community> index && time perl qospol.pl <host> <community> 2 index

ss_qospol.php:
real	0m0.264s
user	0m0.116s
sys	0m0.007s

qospol.pl:
real	0m1.196s
user	0m0.082s
sys	0m0.038s
So you see, almost a second faster :D

Keep in mind! New data and graph templates with new DS-names probably means that a clean update of your old qospol.pl templates isnt possible, also stuff will most likely BREAK -> BACK STUFF UP BEFORE!

@coders/devs: yeah, i know, its ugly coded and could probably loose 1/3rd of its size by using variables more/better. But it works. :)
Hi!
I have update this script
"get" function is simplified ,also resolved bug with empty outbound data on cisco2800
changes only inside ss_qospol.php,

tested on Cisco 2821 Cisco 3845
i will appreciate for any feedback.
Attachments
ss_qospol.php_09022012_linvinus.txt
follow instructions at http://forums.cacti.net/viewtopic.php?p=176111#p176111, and rename ss_qospol.php_09022012_linvinus.txt to ss_qospol.php
(16.64 KiB) Downloaded 588 times

veasna
Posts: 1
Joined: Wed Sep 19, 2012 11:20 pm

Re: Cisco Router - Class Map statistics

#43 Post by veasna » Fri Sep 28, 2012 12:23 am

Dear All,

I have tried to use that template, it is very useful and helpful. But I got with other issue cause it could not query the class from port-channel. Is there anyway to solve this problem?

Cacti Version 0.8.7e

Thanks in advance for support and help,

Veasna

Sophanith
Posts: 21
Joined: Fri Aug 08, 2014 3:38 am

Re: Cisco Router - Class Map statistics

#44 Post by Sophanith » Wed Jan 11, 2017 11:09 pm

Dear All,

Any 64bit counter template update for this pls?
Last edited by Sophanith on Thu Jan 19, 2017 10:41 pm, edited 1 time in total.

Sophanith
Posts: 21
Joined: Fri Aug 08, 2014 3:38 am

Re: Cisco Router - Class Map statistics

#45 Post by Sophanith » Fri Jan 13, 2017 3:56 am

Hi All,

Can anyone share and updated scripts with 64 bits encounter?

Post Reply