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

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

Moderators: Developers, Moderators

Post Reply
hybrid
Posts: 4
Joined: Thu Nov 22, 2007 4:37 pm

Post by hybrid »

Yep, that worked for me too, thanks!
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

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
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
alexcf
Posts: 17
Joined: Thu Jul 10, 2003 8:09 pm

Post by alexcf »

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.
nathangregory.com
Posts: 3
Joined: Sun Feb 01, 2009 10:30 pm

Post by nathangregory.com »

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.
Alex, I'm having the same issue as you.
Running of the latest CactiEZ install.
Would love to know how to solve this.

Regards
And
Posts: 23
Joined: Thu Jun 12, 2008 8:36 am

Post by And »

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 :)
morten
Posts: 9
Joined: Wed Jan 14, 2009 1:54 am

No luck getting NBAR data

Post by morten »

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 :o Success [0 Items, 0 Rows]
morten
Posts: 9
Joined: Wed Jan 14, 2009 1:54 am

Solved

Post by morten »

:D 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");
User avatar
ARC1450
Cacti User
Posts: 104
Joined: Wed Jun 24, 2009 9:42 am

Post by ARC1450 »

I don't suppose anyone has gotten this to work against a Cisco ASR, have they?
MarsRover
Posts: 6
Joined: Wed Oct 07, 2009 3:29 pm

Post by MarsRover »

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.
redk3y
Posts: 2
Joined: Wed Oct 14, 2009 8:47 am

Post by redk3y »

I thought it was getting worked on at one point. I remember seeing a post saying "this is where someone else needs to take over". I am anxiously awaiting the ability to graph my nbar stats again....if anyone has come up with a solid solution in 0.8.7, please post!
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

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
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 »

Jay,

That is not the only code that needs to be changed. "cactisnmpget" and "cactisnmpwalk" changed from version 0.8.6 to 0.8.7. The script and XML need to be re-written.
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

:(

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
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

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

Post by MarsRover »

Thanks. I'm checking it out now.

Edit: Looks like a bunch of Windows Characters were included with the files you uploaded. I'm removing it right now, then I'll test.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests