[XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED]
Moderators: Developers, Moderators
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
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
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
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
Escape the Community String
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:
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:
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
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)
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);
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
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
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
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
-
- Posts: 6
- Joined: Thu Apr 01, 2010 7:11 am
SNMPv3 support
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
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
Re: [XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED
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.
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.
Re: [XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED
This script cant not running in my 7200 router but working with 1800 series..
dont know why
dont know why
-
- Posts: 1
- Joined: Tue Nov 08, 2011 1:24 pm
Re: [XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED
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.
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:
Can anyone point me in the right direction on where to even begin to debug this? It would be much appreciated.
Thanks!
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:
Can anyone point me in the right direction on where to even begin to debug this? It would be much appreciated.
Thanks!
running "ss_nbar_all.php" failed
imported the templates and scripts, snmp-check-queuries from the forum are working,
but my Data Query Debug Information dumps:
Index Count: 0 ## : \
seems this is the problem:
I'm using cacti 0.8.8a with PHP 5.4.4
any ideas ?
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'
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:~#
any ideas ?
-
- Posts: 1
- Joined: Wed May 28, 2014 6:15 am
Re: [XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED
Hi there guys,
Please could you really help with this??
No items, No raws
Please could you really help with this??
No items, No raws
- Attachments
-
- N.jpg (191.45 KiB) Viewed 3406 times
Who is online
Users browsing this forum: No registered users and 4 guests