[XML] Cisco NBAR Protocol Statistics Query 1.2a [UPDATED]
Moderators: Developers, Moderators
Hi
I was wondering if anyone has seen issues collecting nbar rtp data via snmp? See the following post for more information
http://forums.cacti.net/viewtopic.php?t=26914
Jay
I was wondering if anyone has seen issues collecting nbar rtp data via snmp? See the following post for more information
http://forums.cacti.net/viewtopic.php?t=26914
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
Hi guys,
When running the script on command line, which is basically copying the debug commands, I get the following:
Warning: Missing argument 9 for cacti_snmp_get(), called in /home/cacti/www/scripts/ss_nbar_all.php on line 185 and defined in /home/cacti/www/lib/snmp.php on line 39
Warning: Missing argument 10 for cacti_snmp_get(), called in /home/cacti/www/scripts/ss_nbar_all.php on line 185 and defined in /home/cacti/www/lib/snmp.php on line 39
I get the totals for the interfaces etc, but get blank graphs.. Any help would be much appreciated.
Thanks,
Alex.
When running the script on command line, which is basically copying the debug commands, I get the following:
Warning: Missing argument 9 for cacti_snmp_get(), called in /home/cacti/www/scripts/ss_nbar_all.php on line 185 and defined in /home/cacti/www/lib/snmp.php on line 39
Warning: Missing argument 10 for cacti_snmp_get(), called in /home/cacti/www/scripts/ss_nbar_all.php on line 185 and defined in /home/cacti/www/lib/snmp.php on line 39
I get the totals for the interfaces etc, but get blank graphs.. Any help would be much appreciated.
Thanks,
Alex.
-
- Posts: 3
- Joined: Sun Feb 01, 2009 10:30 pm
Alex, I'm having the same issue as you.alexcf wrote:Hi guys,
When running the script on command line, which is basically copying the debug commands, I get the following:
Warning: Missing argument 9 for cacti_snmp_get(), called in /home/cacti/www/scripts/ss_nbar_all.php on line 185 and defined in /home/cacti/www/lib/snmp.php on line 39
Warning: Missing argument 10 for cacti_snmp_get(), called in /home/cacti/www/scripts/ss_nbar_all.php on line 185 and defined in /home/cacti/www/lib/snmp.php on line 39
I get the totals for the interfaces etc, but get blank graphs.. Any help would be much appreciated.
Thanks,
Alex.
Running of the latest CactiEZ install.
Would love to know how to solve this.
Regards
Hi all,
I have some similar isuues and I found a "half-answer" here:
http://forums.cacti.net/about29262.html
Does anybody know how to fix the script for NBAr in 087*?
Thanks in advance!
And
EDIT:
I spent some time browsing the forum and it looks to work now, after adding the missing "." in the OIDs, the missing INCLUDE and the the null arguments in ss_nbar_all.php
And
I have some similar isuues and I found a "half-answer" here:
http://forums.cacti.net/about29262.html
Does anybody know how to fix the script for NBAr in 087*?
Thanks in advance!
And
EDIT:
I spent some time browsing the forum and it looks to work now, after adding the missing "." in the OIDs, the missing INCLUDE and the the null arguments in ss_nbar_all.php
And
No luck getting NBAR data
1) installed ss-nbar_all-1.2.a.zip as per attached instructions
2) nbar installed on target and snmp walk ok
3) linux installation, but also tried to put "." in front of OIDs in script
Still no success!!!
Any suggestion is warmly appreciated
Output (Verbose Query)
+ Running data query [13].
+ Found type = '6 '[script query].
+ Found data query XML file at '/usr/local/share/cacti/resource/script_server/cisco_nbar_all.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 index'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query index'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query ifName'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query ifType'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query ifAdminStatus'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query ifOperStatus'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query protoname'
+ Found data query XML file at '/usr/local/share/cacti/resource/script_server/cisco_nbar_all.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/script_server/cisco_nbar_all.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/script_server/cisco_nbar_all.xml'
1) Cisco Router - NBAR (All Stats) (Verbose Query) Uptime Goes Backwards Success [0 Items, 0 Rows]
2) nbar installed on target and snmp walk ok
3) linux installation, but also tried to put "." in front of OIDs in script
Still no success!!!
Any suggestion is warmly appreciated
Output (Verbose Query)
+ Running data query [13].
+ Found type = '6 '[script query].
+ Found data query XML file at '/usr/local/share/cacti/resource/script_server/cisco_nbar_all.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 index'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query index'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query ifName'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query ifType'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query ifAdminStatus'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query ifOperStatus'
+ Executing script query '/usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_nbar_all.php 10.20.128.17 lessuR 1 query protoname'
+ Found data query XML file at '/usr/local/share/cacti/resource/script_server/cisco_nbar_all.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/script_server/cisco_nbar_all.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/script_server/cisco_nbar_all.xml'
1) Cisco Router - NBAR (All Stats) (Verbose Query) Uptime Goes Backwards Success [0 Items, 0 Rows]
Solved
Solved thanks to this post:
I had trouble getting this to work on 0.8.7a. I was using the plugin arch. It located all of the files (xml, php, etc) and never gave me an error via cacti but would return 0 rows. When I would run the script via CLI with a
Code:
php -q ss_nbar_all.php x.x.x.x commstring 2 query index
I would get
Code:
Fatal error: Call to undefined function read_config_option() in /var/www/xxxx/cacti/lib/snmp.php on line 233
I added the following line into ss_nbar_all.php:
Code:
include_once(dirname(__FILE__) . "/../include/global.php");
I had trouble getting this to work on 0.8.7a. I was using the plugin arch. It located all of the files (xml, php, etc) and never gave me an error via cacti but would return 0 rows. When I would run the script via CLI with a
Code:
php -q ss_nbar_all.php x.x.x.x commstring 2 query index
I would get
Code:
Fatal error: Call to undefined function read_config_option() in /var/www/xxxx/cacti/lib/snmp.php on line 233
I added the following line into ss_nbar_all.php:
Code:
include_once(dirname(__FILE__) . "/../include/global.php");
Is there a version of this script that works with Cacti 0.8.7? There are parts of the code that use SNMP v1 and 2, but newer version of Cacti require v3 commands, even if some areas are left blank. I'm currently unable to get the graph to create automatically and display data. If I create the graph manually, not data ever populates. I'm not seeing any errors in my cacti.log, even at debug levels.
Hi
Take a look at
http://forums.cacti.net/viewtopic.php?t=23932
You will also need to update
I added the following line into ss_nbar_all.php:
Code:
include_once(dirname(__FILE__) . "/../include/global.php");
Cheers
Jay
Take a look at
http://forums.cacti.net/viewtopic.php?t=23932
You will also need to update
I added the following line into ss_nbar_all.php:
Code:
include_once(dirname(__FILE__) . "/../include/global.php");
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
Unfortunately I don't use Cacti 8.7 in production and I'm just a simple comms engineer, not a programmer/developer!
I have been looking at some other PHP scripts I use for Cacti and they seem to use the following as a function
function ss_protocol_ip($hostname, $snmp_community, $snmp_version, $snmp_port, $snmp_timeout, $snmpv3_auth_username, $snmpv3_auth_password) {
if (($snmp_version == "1" | $snmp_version == "2")) {
$snmpv3_auth_username = "";
$snmpv3_auth_password = "";
$snmpv3_auth_protocol = "";
$snmpv3_priv_passphrase = "";
$snmpv3_priv_protocol = "";
}
$result = "";
This may help you or may not.
I'm currently looking at our AUS cacti set up as they run 8.7e. I will post my findings soon.
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
Hi
I have checked our AUS server and the script looks the same on initial inspection. I have uploaded it so you can compare for yourself. This works on the AUS server and I can see NBAR graphs being populated. Maybe there are difference in the different 8.7 versions as well.
Cheers
Jay
I have checked our AUS server and the script looks the same on initial inspection. I have uploaded it so you can compare for yourself. This works on the AUS server and I can see NBAR graphs being populated. Maybe there are difference in the different 8.7 versions as well.
Cheers
Jay
- Attachments
-
- nbar_php_test.txt
- (9.19 KiB) Downloaded 461 times
-
- nbar_php_test.xml
- (4.15 KiB) Downloaded 453 times
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
Who is online
Users browsing this forum: No registered users and 7 guests