[XML/PERL] Cisco Remote Ping Template and script
Moderators: Developers, Moderators
[XML/PERL] Cisco Remote Ping Template and script
hi!
My first template
This template is to monitor remote hosts by using the cisco remote ping
Here are the template exported from my cacti 0.8.6a and the perl script used.
The script is an old perl script which was written by Omer Ansari in 2000, and i just format the output to be :
rate:100 min:8 avg:8 max:8
Community MUST be ReadWrite.
First copy the script into "scripts" directory
then import the template
edit "Cisco Remote Ping" in the "Data Input Methods" and verify the perl path.
ATTENTION : i'm using a history of 1 year in daily rra !! rows=105120 for me, default is 600 (edit : "Data Sources" "RRAs")
Output example:
Link to zip file : rping.zip
My first template
This template is to monitor remote hosts by using the cisco remote ping
Here are the template exported from my cacti 0.8.6a and the perl script used.
The script is an old perl script which was written by Omer Ansari in 2000, and i just format the output to be :
rate:100 min:8 avg:8 max:8
Community MUST be ReadWrite.
First copy the script into "scripts" directory
then import the template
edit "Cisco Remote Ping" in the "Data Input Methods" and verify the perl path.
ATTENTION : i'm using a history of 1 year in daily rra !! rows=105120 for me, default is 600 (edit : "Data Sources" "RRAs")
Output example:
Link to zip file : rping.zip
- Attachments
-
- cacti_graph_template_cisco_remote_ping.xml
- 0.8.6h version of xml file
- (19.05 KiB) Downloaded 4608 times
-
- rping.zip
- Cisco Remote ping template and script
- (6.76 KiB) Downloaded 4566 times
Last edited by Mikf on Thu Nov 02, 2006 6:12 am, edited 3 times in total.
-
- Cacti User
- Posts: 52
- Joined: Fri Mar 12, 2004 3:01 am
- Location: Beusichem
- Contact:
-
- Cacti User
- Posts: 52
- Joined: Fri Mar 12, 2004 3:01 am
- Location: Beusichem
- Contact:
Same error...could you send it to me by email? (kc@bfsquad.com) Thnx!
data input methods specifications
Hi,
I am a newbie to Cacti and I am experimenting with running external scripts for Cacti to graph. While adding your perl script to data input methods, how many output fields must i specify and what would be their names? Please let me know about this.
I am a newbie to Cacti and I am experimenting with running external scripts for Cacti to graph. While adding your perl script to data input methods, how many output fields must i specify and what would be their names? Please let me know about this.
you can use many options :
i'm only using -c for community
perl rping.pl -c <your community> <cisco router> <remote host>
Code: Select all
./rping.pl
rping v0.1 RemotePing Facility
Lets you ping machine(s) from router X while sitting on box A!
Freeware by Omer Ansari <omer@ansari.com>
Syntax:
rping [-c comm_string] [-w wait_time] [-t timeout] [-g gap]
[-n probe_count] [-s probe_size] [-h] <Source> <Destination>
rping [-c comm_string] [-w wait_time] [-t timeout] [-g gap]
[-n probe_count] [-s probe_size] [-h] <-f input_file> <Source>
Options:
-c comm_string: The RW community string on the cisco router
(i.e. the <Source>). Default: private
-w wait_time: The amount of time the script waits before
polling the <Source> for the ping results
[Note: Increase this if you're not
getting results] Default: 2s
-t timeout: Defines the timeout value after which the
packet is considered dropped. Default: 3000ms
-g gap: The gap between successive ping probes
Can be set to zero. Default: 3ms
-n probe_count: The number of packets to be sent. Default: 5
-s probe_size: The size of each ping packet. Default: 64bytes
-f input_file: The file which has multiple destinations to ping
-h help: Help (this dump)
perl rping.pl -c <your community> <cisco router> <remote host>
Thanks for the quick response! I appreciate it. Can you send me a detailed documetation on how you did it. It would be ver helpful for me if I have a step by step process for going from script to graph. I also have one other problem. When I import the xml file downloaded from here, it is not showing up in the graph templates menu. Has anyone encountered problems like this?
-
- Posts: 13
- Joined: Thu Sep 16, 2004 12:32 pm
- mpdsville1
- Cacti User
- Posts: 71
- Joined: Wed Mar 16, 2005 12:11 pm
- Location: Albany , NY , USA
CRP..Modify graph to include ping target ..
I wish to modify the graph template to include the
address of the ping target .. I attempted to use
| rhost | variable without success..
What variable can I use in the template to reveal the
ping target of a Cisco Remote Ping in the outputted graph?
Thanks !
address of the ping target .. I attempted to use
| rhost | variable without success..
What variable can I use in the template to reveal the
ping target of a Cisco Remote Ping in the outputted graph?
Thanks !
- Attachments
-
- graph_image.gif (22.7 KiB) Viewed 46364 times
Mike Donnelly , Albany , NY
| Cacti 0.8.7g | Spine 0.8.7g | MySQL 5.0.77 | Net-SNMP 5.3.2.2 | Apache 2.2.3 | PHP 5.3.3 | RRDtool 1.2.27 | Rhel6 | Dual Xeon E5410@2.33ghz | Sunfire x4150
| Cacti 0.8.7g | Spine 0.8.7g | MySQL 5.0.77 | Net-SNMP 5.3.2.2 | Apache 2.2.3 | PHP 5.3.3 | RRDtool 1.2.27 | Rhel6 | Dual Xeon E5410@2.33ghz | Sunfire x4150
Allowing longer Round Trip Times
This script and template works very well but I had trouble when I wanted to monitor response times over a Mobile Data Network. The RTT is usually around 600 to 700 milliseconds.
It took me a while to find out why the success rates were very low and why the lines weren't appearing on the graph.
I had to allow a longer wait time to allow the router to complete the pings before getting the results. Because the RTT is almost 700ms and timeout is 1 second and number of pings is 5 (defaults) I increased the wait time to 6 seconds (rping.pl -w 6 ... ).
The Data Template normally allows a maximum of 100 milliseconds for min, avg and max and I increased them all to 2000.
It took me a while to find out why the success rates were very low and why the lines weren't appearing on the graph.
I had to allow a longer wait time to allow the router to complete the pings before getting the results. Because the RTT is almost 700ms and timeout is 1 second and number of pings is 5 (defaults) I increased the wait time to 6 seconds (rping.pl -w 6 ... ).
The Data Template normally allows a maximum of 100 milliseconds for min, avg and max and I increased them all to 2000.
- Attachments
-
- rping.jpg (56.07 KiB) Viewed 44743 times
Multiple destinations on a source
We have an issue where we are pinging quite a few remote devices from one distribution router. The first ones worked OK but after about 5 or 6 devices the last ones added often wouldn't get any data. I tried running the script manually and would sometimes get no data or an SNMP error "requested table is empty or does not exist'.
When the script is run it creates a SNMP ping entry on the source device. The entry is based on the "$leaf" value. It is set to 90 and then increments by 10 for each destination. The script has the command to destroy the SNMP ping entry commented out. This isn't a problem in this version because the entry is reused.
I think I was losing entries because the script told the router to setup these entries and maybe the router was too slow or fast but it was out of sync with the device.
I changed to a random number for the first leaf. $leaf = int(rand(100)); and uncommented the line:
When the script is run it creates a SNMP ping entry on the source device. The entry is based on the "$leaf" value. It is set to 90 and then increments by 10 for each destination. The script has the command to destroy the SNMP ping entry commented out. This isn't a problem in this version because the entry is reused.
I think I was losing entries because the script told the router to setup these entries and maybe the router was too slow or fast but it was out of sync with the device.
I changed to a random number for the first leaf. $leaf = int(rand(100)); and uncommented the line:
Code: Select all
$response = $session->set_request($ciscoPingEntryStatus_OID, INTEGER, '6');
Who is online
Users browsing this forum: No registered users and 1 guest