[XML/PERL] Cisco Remote Ping Template and script

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

Moderators: Moderators, Developers

Author
Message
Mikf
Posts: 47
Joined: Fri Aug 13, 2004 11:35 am
Location: Paris, France

[XML/PERL] Cisco Remote Ping Template and script

#1 Post by Mikf » Wed Oct 06, 2004 12:35 pm

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: Image

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 3673 times
rping.zip
Cisco Remote ping template and script
(6.76 KiB) Downloaded 3964 times
Last edited by Mikf on Thu Nov 02, 2006 6:12 am, edited 3 times in total.

..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

#2 Post by ..::BFS::.. » Fri Oct 08, 2004 2:51 am

Could you repost the script? If I try to download it I get the download.php (used save as and just a single left click)

Mikf
Posts: 47
Joined: Fri Aug 13, 2004 11:35 am
Location: Paris, France

#3 Post by Mikf » Fri Oct 08, 2004 3:27 am

attachment reposted

..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

#4 Post by ..::BFS::.. » Fri Oct 08, 2004 3:38 am

Same error...could you send it to me by email? ([email protected]) Thnx!

Guest

#5 Post by Guest » Fri Oct 08, 2004 11:36 am

I guess something is wrong with the .zip links in cacti forum :S I just cant download any file in that format...

Mikf
Posts: 47
Joined: Fri Aug 13, 2004 11:35 am
Location: Paris, France

#6 Post by Mikf » Fri Oct 08, 2004 12:54 pm

i have added a link to the zip file

guest

data input methods specifications

#7 Post by guest » Wed Oct 13, 2004 12:08 pm

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.

Mikf
Posts: 47
Joined: Fri Aug 13, 2004 11:35 am
Location: Paris, France

#8 Post by Mikf » Wed Oct 13, 2004 12:40 pm

you can use many options :

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 <[email protected]>

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)
i'm only using -c for community

perl rping.pl -c <your community> <cisco router> <remote host>

Guest

#9 Post by Guest » Wed Oct 13, 2004 1:47 pm

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?

ptsiaras
Posts: 11
Joined: Wed Oct 06, 2004 7:22 am

#10 Post by ptsiaras » Tue Oct 19, 2004 10:17 am

Hello
Do you try to import the template in the 0.6.8b version ?
I follow the steps by adding the script & the xml but the cacti interface is not showing the new data input method
Kind Regards

shreekarthik
Posts: 13
Joined: Thu Sep 16, 2004 12:32 pm

#11 Post by shreekarthik » Tue Oct 19, 2004 11:43 am

Hi,
I am using the latest version and it is working now. The template shows up in data sources. In the earlier version of cacti I could not import the template at all.

User avatar
mpdsville1
Cacti User
Posts: 71
Joined: Wed Mar 16, 2005 12:11 pm
Location: Albany , NY , USA

CRP..Modify graph to include ping target ..

#12 Post by mpdsville1 » Mon Jul 30, 2007 9:27 am

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 !
Attachments
graph_image.gif
graph_image.gif (22.7 KiB) Viewed 38326 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 [email protected] | Sunfire x4150

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#13 Post by gandalf » Mon Jul 30, 2007 1:48 pm

Support for using "private" script variables is working for Data Queries only. There have been some improvements with latest 0.8.6k (currently beta status), but I'm quite sure they will not work on Data Input Methods
Reinhard

duanew
Posts: 16
Joined: Tue Apr 03, 2007 12:04 am
Location: Brisbane, Australia

Allowing longer Round Trip Times

#14 Post by duanew » Wed Dec 05, 2007 9:42 pm

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.
Attachments
rping.jpg
rping.jpg (56.07 KiB) Viewed 36705 times

duanew
Posts: 16
Joined: Tue Apr 03, 2007 12:04 am
Location: Brisbane, Australia

Multiple destinations on a source

#15 Post by duanew » Fri Dec 14, 2007 1:24 am

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:

Code: Select all

$response = $session->set_request($ciscoPingEntryStatus_OID, INTEGER, '6');

Post Reply