[XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED]

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

Moderators: Developers, Moderators

Post Reply
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

Yeah sorry about that. I couldn't copy the files across so just copied and pasted them into wordpad.
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
MarsRover
Posts: 6
Joined: Wed Oct 07, 2009 3:29 pm

Post by MarsRover »

Nope, no luck. Tried the fresh script, then tried re-writing it to match the query for SNMP v3. I'll wait to see if someone else has an idea or a working version. Thanks for the help, Jay.
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

No worries. Sorry I couldn't help any further. I would be interested in an updated version that works with the latest Cacti versions as I will be upgrading at some point .
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
ifly4pie
Posts: 1
Joined: Tue Oct 20, 2009 4:21 pm
Location: South Dakota, USA

Escape the Community String

Post by ifly4pie »

hi guys,

I've also been having the issue where it returns 0 rows. here's what I've done so far:

I'm running Cacti 0.8.7a, and I get the proper results when I run an snmp-walk on the MIB.

1. I first tried the Eatworms NBAR script, and it looked good, but I got 0 rows returned.

2. I upgraded to the ss_nbar_all file at the beginning of this thread. Same problems listed here.

3. I added the the global.php include statement as listed above, too. No difference.

4. I updated the ss_nbar_all.php file to include 4 new null arguments for the 0.8.7x and SNMPv3 issues. This is for each call to cacti_snmp_get() like this:

Code: Select all

cacti_snmp_get($hostname, $snmp_community, $t_oid, $snmp_version, "", "", "", "", "", "", 161, 1000)
Still didn't work - no change.

5. I tried to run it on the command line, and nothing happened. Then it dawned on me that my SNMP community string needed to be escaped because it had some special characters in it like @,#, and $.

As soon as I escaped my string, it ran fine on the command line. So I went back to Cacti, updated my community string with the \ escapes. Now, my normal queries stopped working, but the NBAR query did finally work, and returned all the rows!

Finally, I tried to figure out a way to escape the string in the ss_nbar_all.php file. There's a php function that really helps with this:

Code: Select all

escapeshellcmd ($command); 
Putting the escape inside the ss_nbar_all.php file won't do any good...because it's already being sent over the command line incorrectly before it gets here. So, the Cacti code for Get Script Server needs updating to escape the community string. (yes, I realize that I don't have the latest version to test it - maybe it's fixed by now - something I will check on.)

My workaround:
I had to create another community string just to make NBAR work. This string only uses letters and numbers, and I'm disappointed that I can't use special characters for security. But I do have it restricted with a Cisco Access Control List, so that makes me a little more comfortable.

Let me know if any of you have other ideas on how to escape the community string.

Thanks,
Josh
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

Hi Josh

Thanks for the information. Hopefully this will help others having issues. It might explain why our AUS Cacti server is able to get nbar stats without modifying the script, as I know they don't use special characters in their community strings.

Wonder if this is the cause of an issue I'm having with the cbwfq script as our global WAN routers have special characters in the community...mmmmm!!

Maybe you could submit a bug report in case some hard coding is required in Cacti.

Cheers

Jay
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
MarsRover
Posts: 6
Joined: Wed Oct 07, 2009 3:29 pm

Post by MarsRover »

I'm going to try the work around now. I'll update in a few hours with my results.
MarsRover
Posts: 6
Joined: Wed Oct 07, 2009 3:29 pm

Post by MarsRover »

...and they will sing the praises of ifly4pie for ages to come. It's working on an individual protocol level without any problems and I'm very happy about that. The "NBAR - Stacked Protocols" graph isn't graphing, but I should be able to work something out. Thanks for all the help, guys.
redk3y
Posts: 2
Joined: Wed Oct 14, 2009 8:47 am

Post by redk3y »

So close...I can see per-protocol graphs in 0.8.7d when I use the realtime plugin, this just started after adding the 4 null args into the php file.

It appears though that my 5 min graphs and for that matter all others are not graphing properly...
helge.wiethoff
Posts: 6
Joined: Thu Apr 01, 2010 7:11 am

SNMPv3 support

Post by helge.wiethoff »

Hi,

just implemented SNMPv3-Support for this Script. For me its working with few reservations. (Take a look at this topic: http://forums.cacti.net/viewtopic.php?t=36820 )

So far the stacked-Graph dont work for me either and looks not very nice... Maybe in the next days.

greetings,
helge
Attachments
ss_nbar_all-1.2b.zip
(9.27 KiB) Downloaded 903 times
apereira
Posts: 22
Joined: Mon Sep 29, 2008 9:58 am

Post by apereira »

I'm having a problem with the results on graphs, there is showing values in T (terabits?)

But I dont have this througputh here, so there is my questions:

It monitor avg/sec? or avg/5min?

This values are wrong? How can I fix it?


Thanks.
ariantow
Posts: 1
Joined: Thu Jan 27, 2011 10:58 pm

Re: [XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED

Post by ariantow »

hi there,

thanks for your update, but i got this error message while import data template

Error: XML: Hash version does not exist.

does anyone know how to solve this ??

thanks.
debrite
Posts: 1
Joined: Tue Mar 08, 2011 2:39 am

Re: [XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED

Post by debrite »

This script cant not running in my 7200 router but working with 1800 series..
dont know why :(
Chairmonkey
Posts: 1
Joined: Tue Nov 08, 2011 1:24 pm

Re: [XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED

Post by Chairmonkey »

Not sure if this thread is dead or not, but I'm so close to getting this work and at a complete loss as to what to do. I have the NBAR (All Stats) query running just fine inside of Cacti, returning plenty of rows.

Image

As you can see, the graph template for the stacked graph states that it's being graphed, however the graph doesn't actually show up inside of Cacti. This is all I see when trying to view the graph:

Image

Can anyone point me in the right direction on where to even begin to debug this? It would be much appreciated.

Thanks!
User avatar
floaty
Posts: 21
Joined: Tue Mar 06, 2007 10:27 am

running "ss_nbar_all.php" failed

Post by floaty »

imported the templates and scripts, snmp-check-queuries from the forum are working,

but my Data Query Debug Information dumps:

Code: Select all

+ Running data query [19].
+ Found type = '6' [Script Query - Script Server].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/cisco_nbar_all.xml'
+ XML file parsed ok.
+ <arg_num_indexes> missing in XML file, 'Index Count Changed' not supported
+ Executing script for list of indexes '"/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_nbar_all.php 192.168.XXX.YYY MYCSTRING 2 index' Index Count: 0
+ Executing script query '"/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_nbar_all.php 192.168.XXX.YYY MYCSTRING 2 query index'
+ Executing script query '"/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_nbar_all.php 192.168.XXX.YYY MYCSTRING 2 query ifName'
+ Executing script query '"/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_nbar_all.php 192.168.XXX.YYY MYCSTRING 2 query ifType'
+ Executing script query '"/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_nbar_all.php 192.168.XXX.YYY MYCSTRING 2 query ifAdminStatus'
+ Executing script query '"/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_nbar_all.php 192.168.XXX.YYY MYCSTRING 2 query ifOperStatus'
+ Executing script query '"/usr/bin/php" -q /usr/share/cacti/site/scripts/ss_nbar_all.php 192.168.XXX.YYY MYCSTRING 2 query protoname'
Index Count: 0 ## : \


seems this is the problem:

Code: Select all

cerbo:~# /usr/bin/php -q  /usr/share/cacti/site/scripts/ss_nbar_all.php 192.168.XXX.YYY MYCSTRING 2 index
PHP Fatal error:  Call-time pass-by-reference has been removed in /usr/share/cacti/site/scripts/ss_nbar_all.php on line 58
cerbo:~# 
I'm using cacti 0.8.8a with PHP 5.4.4

any ideas ?
mikepakizer
Posts: 1
Joined: Wed May 28, 2014 6:15 am

Re: [XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED

Post by mikepakizer »

Hi there guys,
Please could you really help with this??
No items, No raws
Attachments
N.jpg
N.jpg (191.45 KiB) Viewed 3409 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests