Cisco CBWFQ monitoring
Moderators: Developers, Moderators
script by MOONMAN
If interface name contains ":", as in my case
Serial0/0/0:1
change in cbwfq.xml
<output_delimeter>:</output_delimeter>
at
<output_delimeter>!</output_delimeter>
and make corresponding changes in cbwfq.pl
Serial0/0/0:1
change in cbwfq.xml
<output_delimeter>:</output_delimeter>
at
<output_delimeter>!</output_delimeter>
and make corresponding changes in cbwfq.pl
Re: script by MOONMAN
cool, where abouts on the cbwfq.pl do you change it.SergM wrote:If interface name contains ":", as in my case
Serial0/0/0:1
change in cbwfq.xml
<output_delimeter>:</output_delimeter>
at
<output_delimeter>!</output_delimeter>
and make corresponding changes in cbwfq.pl
thanks
moonman wrote:Here is beter looking script now with XML and data query template
To install
1. put the cbwfq.pl in your cacti scripts directory
2. cbwfq.xml in resource/script_queries/
3. import the data query template to your cacti
Nitzan
HI, I am trying to import the templates in and I get "incorrect hash"
Any ideas
Can you please repost??
Thanks
Windows based install
I am using the scripts posted by moonman and am trying to get this to run on win32.
The scripts imported fine
Perl is installed
I added the data source in Cacti
Problem is when I add it to a router that has a policy-map I get back 0 rows, 0 items.
Below is a verbose output:
+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at 'D:/apache2/Apache2/htdocs/cacti/resource/script_queries/cbwfq.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl D:\apache2\Apache2\htdocs\cacti\scripts\cbwfq.pl 10.2.0.1 nwfusion index'
+ Executing script query 'perl D:\apache2\Apache2\htdocs\cacti\scripts\cbwfq.pl 10.2.0.1 nwfusion query class'
+ Found data query XML file at 'D:/apache2/Apache2/htdocs/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at 'D:/apache2/Apache2/htdocs/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at 'D:/apache2/Apache2/htdocs/cacti/resource/script_queries/cbwfq.xml'
I edited the paths in the cbwfq.pl
What else do I need to change to fet it to return data?
The scripts imported fine
Perl is installed
I added the data source in Cacti
Problem is when I add it to a router that has a policy-map I get back 0 rows, 0 items.
Below is a verbose output:
+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at 'D:/apache2/Apache2/htdocs/cacti/resource/script_queries/cbwfq.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl D:\apache2\Apache2\htdocs\cacti\scripts\cbwfq.pl 10.2.0.1 nwfusion index'
+ Executing script query 'perl D:\apache2\Apache2\htdocs\cacti\scripts\cbwfq.pl 10.2.0.1 nwfusion query class'
+ Found data query XML file at 'D:/apache2/Apache2/htdocs/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at 'D:/apache2/Apache2/htdocs/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at 'D:/apache2/Apache2/htdocs/cacti/resource/script_queries/cbwfq.xml'
I edited the paths in the cbwfq.pl
What else do I need to change to fet it to return data?
Windows based install
I got it running. Yeah!! I think this is awesome, so a big thank you to the developers of this script for writing it and being willing to share.
For those of you who are trying to get this to run in windows, here are the trouble shooting steps I followed:
1. Installed Perl. (probably don't need this since its bundled with Net-snmp)
2. Edited the following items in the cbwfq.pl script
A. Change the path to snmpget.exe
B. Change the path to snmpwalk.exe
C. Change the filter to .* (script dependent)
C. Change the order of "-c $node $comm" to "-c $comm $node" in several places.
3. My MIBDIR environment variable was D:\PHP\MIB so I copied the Net-SNMP MIBs to this directory.
Then things started working. I believe the MIBDIR was the primary issue.
For those of you who are trying to get this to run in windows, here are the trouble shooting steps I followed:
1. Installed Perl. (probably don't need this since its bundled with Net-snmp)
2. Edited the following items in the cbwfq.pl script
A. Change the path to snmpget.exe
B. Change the path to snmpwalk.exe
C. Change the filter to .* (script dependent)
C. Change the order of "-c $node $comm" to "-c $comm $node" in several places.
3. My MIBDIR environment variable was D:\PHP\MIB so I copied the Net-SNMP MIBs to this directory.
Then things started working. I believe the MIBDIR was the primary issue.
Stackable Graphs
Is there any template to have all QoS Classes for an interface in one Graph?
CBWFQ and Cacti
Hi
I am also having exactly same problem. How did you resolve this
I am also having exactly same problem. How did you resolve this
sohailb wrote:Im not sure which screens you want me to share. Here is what I have done... I imported the template, copied the script and xml file into the right locations, and set up the data input method. When I add this data query to a host, it does show me the names of the classes and from which interface they belong. When I try to graph them, rather than showing the previously shown name, it now shows |query_class| instead. At this point, I let it run for a while to get some data and when I check the graphs, they are all red x's. I check the graph debug and it states that the rrd's can not be found.
When I use the original templates, script, and xml, I can generate graphs and they get data and all that good stuff. The only problem I have with this is that the script is slow sometimes and cactid has issues with it after 296 seconds.
I would like to use your script with the orginal templates since your script is supposed to be faster.
-sohailb
-
- Cacti User
- Posts: 53
- Joined: Mon Nov 29, 2004 11:43 am
Please post the result of
snmpwalk -c COMM -v2c IP .1.3.6.1.4.1.9.9.166.1.7.1.1.1
snmpwalk -c COMM -v2c IP .1.3.6.1.4.1.9.9.166.1.6.1.1.1
snmpwalk -c COMM -v2c IP .1.3.6.1.4.1.9.9.166.1.1.1.1.4
snmpwalk -c COMM -v2c IP .1.3.6.1.2.1.2.2.1.2
snmpwalk -c COMM -v2c IP .1.3.6.1.4.1.9.9.166.1.5.1.1.2
I hope I can help
snmpwalk -c COMM -v2c IP .1.3.6.1.4.1.9.9.166.1.7.1.1.1
snmpwalk -c COMM -v2c IP .1.3.6.1.4.1.9.9.166.1.6.1.1.1
snmpwalk -c COMM -v2c IP .1.3.6.1.4.1.9.9.166.1.1.1.1.4
snmpwalk -c COMM -v2c IP .1.3.6.1.2.1.2.2.1.2
snmpwalk -c COMM -v2c IP .1.3.6.1.4.1.9.9.166.1.5.1.1.2
I hope I can help
-
- Posts: 3
- Joined: Fri Oct 14, 2005 6:02 pm
moonman's script
moonman,
First of all, thanks for creating this script. I followed your instructions, but I'm unable to retrieve any data (0 rows, 0 items). Data query debug shows:
+ Running data query [10].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString index'
+ Executing script query 'perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString query class'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
When I execute the scripts manually, I do get output:
[cacti@cacti scripts]# perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString index
1483.1485
1483.1491
1769.1771
1769.1777
1769.1783
[cacti@cacti scripts]# perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString query
1483.1485:cbbtv-WAN_TO_ANNEX-Serial3/0
1483.1491:class-default-WAN_TO_ANNEX-Serial3/0
1769.1771:gep-WAN_TO_SIF-ATM4/ima1.100-aal5
1769.1777:cbbtv-WAN_TO_SIF-ATM4/ima1.100-aal5
1769.1783:class-default-WAN_TO_SIF-ATM4/ima1.100-aal5
[cacti@cacti scripts]#
Unlike the previously posted script, yours does NOT require me to create a Data Input Method, correct? Any help would be appreciated. Thanks.
[/quote]
First of all, thanks for creating this script. I followed your instructions, but I'm unable to retrieve any data (0 rows, 0 items). Data query debug shows:
+ Running data query [10].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString index'
+ Executing script query 'perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString query class'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
When I execute the scripts manually, I do get output:
[cacti@cacti scripts]# perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString index
1483.1485
1483.1491
1769.1771
1769.1777
1769.1783
[cacti@cacti scripts]# perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString query
1483.1485:cbbtv-WAN_TO_ANNEX-Serial3/0
1483.1491:class-default-WAN_TO_ANNEX-Serial3/0
1769.1771:gep-WAN_TO_SIF-ATM4/ima1.100-aal5
1769.1777:cbbtv-WAN_TO_SIF-ATM4/ima1.100-aal5
1769.1783:class-default-WAN_TO_SIF-ATM4/ima1.100-aal5
[cacti@cacti scripts]#
Unlike the previously posted script, yours does NOT require me to create a Data Input Method, correct? Any help would be appreciated. Thanks.
[/quote]
Re: moonman's script
Check the exec/read permissions on the cbwfq.pl script. I had a problem with not enough permissions on this file and it looked exactly the same.cactiSteve wrote:moonman,
First of all, thanks for creating this script. I followed your instructions, but I'm unable to retrieve any data (0 rows, 0 items). Data query debug shows:
+ Running data query [10].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString index'
+ Executing script query 'perl /var/www/cacti/scripts/cbwfq.pl myRouter myCommString query class'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/cbwfq.xml'
When I execute the scripts manually, I do get output:
...
WM
-
- Posts: 3
- Joined: Fri Oct 14, 2005 6:02 pm
Re: moonman's script
Thanks for the suggestion, woytekm, but that doesn't appear to be the problem. The script is world-readable, like all of the other scripts in that directory:
-rw-r--r-- 1 root root 4861 Oct 17 14:57 cbwfq.pl
...and I can execute this script (via perl) just fine from the command line as cactiuser (and as any other user, too).
Regards,
Steve
-rw-r--r-- 1 root root 4861 Oct 17 14:57 cbwfq.pl
...and I can execute this script (via perl) just fine from the command line as cactiuser (and as any other user, too).
Regards,
Steve
-
- Posts: 3
- Joined: Fri Oct 14, 2005 6:02 pm
Re: moonman's script
Success!
The source of the problem was that my server was running selinux, and it was not allowing snmpwalk (called from the perl script by user apache) to open a socket to connect to my router to retrieve the data. This explains why the perl script would work when executed from a shell prompt, but not from within Cacti.
To disable selinux at startup:
Change this line in /etc/sysconfig/selinux:
SELINUX=enabled
to:
SELINUX=disabled
and reboot.
There's probably a way to modify the selinux profile to make this work and still use selinux, but I don't need selinux, so I simply disabled it.
A big thank-you to moonman for creating the scripts.
Regards,
Steve
The source of the problem was that my server was running selinux, and it was not allowing snmpwalk (called from the perl script by user apache) to open a socket to connect to my router to retrieve the data. This explains why the perl script would work when executed from a shell prompt, but not from within Cacti.
To disable selinux at startup:
Change this line in /etc/sysconfig/selinux:
SELINUX=enabled
to:
SELINUX=disabled
and reboot.
There's probably a way to modify the selinux profile to make this work and still use selinux, but I don't need selinux, so I simply disabled it.
A big thank-you to moonman for creating the scripts.
Regards,
Steve
Who is online
Users browsing this forum: No registered users and 5 guests