EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6g

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

Moderators: Developers, Moderators

Post Reply
TomekN
Posts: 13
Joined: Thu Mar 02, 2006 7:15 am
Location: Warsaw, Poland

Post by TomekN »

I like this advanced ping graph template very much, but as I understand
by the way it works it measures ping latency to the host being monitored.

What I'd like to do is to graph ping latency from host being monitored
to machine X
(lets say google.com), preferably fetched by SNMP.
How to achive that?

My current idea is to:
1. write a shell script that pings X and returns 5 vaules
2. add this script command as exec into snmpd.conf of monitored host
3. exec will put ping results into ucd mib
4. creade 5 new DS in cacti for that oids
5. bind that DS to advanced ping tempate 1.3 :D

WDYF?
lnxflocki
Posts: 5
Joined: Mon Mar 13, 2006 9:32 am

Post by lnxflocki »

I'm having the same issue as nerdtalker. I've upgraded cacti and cactid from the previous to the latest version (0.8.6g to h and f to g respectively) and suddenly the graphs started to report 100% packet loss on all devices.

I've tried running the ss_fping.php command through the script server:

Code: Select all

# php script_server.php
PHP Script Server has Started - Parent is cmd
/var/www/html/cacti/scripts/ss_fping.php ss_fping db1 20 ICMP
min:0.1700 avg:0.1845 max:0.2300 dev:0.0140 loss:0.0000
values match my classic unix ping and there's no packet loss. the graphs however still show 100% packet loss. I've increased the poller logging level to medium and checked the logfile:

Code: Select all

03/13/2006 03:35:03 PM - CACTID: Poller[0] Host[43] DS[311] SS[0] SERVER: /var/www/html/cacti/scripts/ss_fping.php ss_fping db1 20 ICMP, output: min:0.1700 avg:0.1860 max:0.2400 dev:0.0177 loss:0.0000
I don't see any obvious errors in the log. I've never seen this behavior until I upgraded cacti this morning.

Running RHEL3, rrdtool 1.0.x, net-snmp 5.0.x. I used the SRPMS and rebuilt them myself (rpmbuild --rebuild).

Any help would be appreciated
c7borg
Posts: 11
Joined: Mon Mar 13, 2006 9:39 am

Post by c7borg »

TomekN wrote:I like this advanced ping graph template very much, but as I understand
by the way it works it measures ping latency to the host being monitored.

What I'd like to do is to graph ping latency from host being monitored
to machine X
(lets say google.com), preferably fetched by SNMP.
How to achive that?

My current idea is to:
1. write a shell script that pings X and returns 5 vaules
2. add this script command as exec into snmpd.conf of monitored host
3. exec will put ping results into ucd mib
4. creade 5 new DS in cacti for that oids
5. bind that DS to advanced ping tempate 1.3 :D

WDYF?
I'm not sure how that would differ from having a ping running from your management station (cacti) to each of the devices then a single ping to "google.com" just place you management station close to the perimeter of your network, frees up a few extra bps for your wan link and gives google a break :)

I am assuming you would be better to monitor the individual devices latency across your network rather than that of the Internet which would be the same from any device, besides wouldn't the graph always show the weakest point which would be out in the wilds of the Internet..
cwahlin
Cacti User
Posts: 91
Joined: Fri Oct 10, 2003 7:23 am

Post by cwahlin »

I have a small issue with this script. I get the following poller error:
03/16/2006 01:22:34 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/share/cacti/rra/kn2z12r_loss_89.rrd --template 1142468552:U
ERROR: Not enough arguments
But if I run the script as root it works fine (exactly what I find i the poller cache):
php /usr/share/cacti/scripts/ss_fping.php kn2-z12r.stokab.net 20
min:0.7300 avg:1.1875 max:1.5400 dev:0.1732 loss:0.0000
Update: It seems to be related to the ss_fping in the "Input String":
<path_cacti>/scripts/ss_fping.php ss_fping <hostname> <attempts> <protocol> <port>

If I try with it looking like above it works, I get the graph, but with 100% loss. (same running the script as root, 100% lost). When I take out the ss_fping I get good results running the script as root, but the poller says "Not enough arguments" in debug mode and I get no graph.

running the script as the Input String in the scriptserver (as root) works fine, but not when I run the scriptserver as cactiuser (100% loss).

Permission problem? Where? :)

/Carl
The00Dustin
Posts: 24
Joined: Thu Jan 05, 2006 5:52 pm

Beginning Troubleshooting Pointer?

Post by The00Dustin »

I have the latest version of everything for Advanced Ping Template 1.3 downloaded and I get nan for everything. I use Cactid and cronjob is run by root. I read some things I thought would fix it, but then I didn't have time (this was some time ago) and now I can't remember what they were or find them again. It could most certainly be very simple and I would apprecaite a pointer to step-bysstep installation instructions along with a pointer to step-by-step troubleshooting instructions for the most typical problems (if such instructions exist). I know all the info is here somewhere, but I suck with keywords. TIA
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Is there some actual technical reason why the Advanced Ping template creates it's own ping packets rather than using an existing (SUID root) ping program like fping? I can see why you wouldn't use the system's ping command because the output varies greatly, but fping was specifically designed for this type of thing, and can even parallelise the pings to multiple hosts.

As I see it, if you have a device that only responds to 'real' pings, like the WAN side of some DSL routers, then UDP/TCP pings don't help, sadly.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
bfek-18
Posts: 24
Joined: Mon Oct 27, 2003 9:13 am
Location: Germany, Potsdam

hostname tcp:192.168.1.1

Post by bfek-18 »

Hallo,

if that hostname like tcp:192.168.1.1 the script ss_fping.php not work correct.
That patch solve this problem.

bye uk
Attachments
ss_fping.php.zip
(409 Bytes) Downloaded 737 times
KaiB
Posts: 14
Joined: Sun Mar 19, 2006 11:04 am
Location: Norway

Post by KaiB »

Heya.

Im a bit stuck with this addon.

Some info on my setup:

Webserver: IIS 6.0
Cacti: 0.8.6h
Cactid:0.8.6g
MySQL: 4.1.18
PHP: 5.1.2
RRDTool: 1.2 Cygwin zip
Net-SNMP: 5.3.0.1-1

Basicly the script works excelent in CLI but Cacti doesnt want to update the rrd file.
I have tried using it against an already monitored cisco router and a local computer.
Both ICMP and TCP gives same result wich is:

Code: Select all

 03/28/2006 08:38:05 PM - CACTID: Poller[0] Host[28] DS[139] SS[0] SERVER: /Cacti/scripts/ss_fping.php ss_fping 10.6.1.207 20 ICMP, output: U  
03/28/2006 08:38:05 PM - CACTID: Poller[0] Host[28] DS[139] SS[0] WARNING: Result from SERVER not valid. Partial Result: ...  
Manual entry gives this:

Code: Select all

Cacti\scripts>php ss_fping.php 10.6.1.207 20 ICMP
min:0.7300 avg:0.9125 max:1.3900 dev:0.1322 loss:0.0000
I dont have any problems with traffic monitoring of hosts if that helps.
Regards
KaiB
Posts: 14
Joined: Sun Mar 19, 2006 11:04 am
Location: Norway

Post by KaiB »

OK, I have tried everything I coud come up with now and I just cant seem to get cactid to work with this script.

Manually I get expected result from cmd line and the script server, if I change to Script/Command instead and modify the armgument thereafter i get the "Not enough arguments" instead.

Cant find any permission issues in Filemon in any case either.

cmd.php works fine though, but uses like twise the time of cactid and im getting nasty close to a new run when the last finished so I cant add more data sources until I get this issue resolved :(

Any ideas anyone?
Regards
jordi
Posts: 7
Joined: Fri Apr 07, 2006 11:07 pm

Post by jordi »

TheWitness wrote:Please debug the script server from the command line:

a) Start the Script Server

cd <cacti_root>
php script_server

b) Obtain the script line from the poller cache

System Utilities->View Poller Cache
Search for "Action: 2" that contains the ss_fping.php line

c) Run from the script server

Paste the entire line ending in "TCP 80" into the script server window and hit <CR>

d) Quit the script server

quit <CR>

Post the output.

TheWitness
I had the same issue and below is my output -

[root@honweb rra]# /usr/local/php/bin/php ../script_server.php
PHP Script Server has Started - Parent is cmd
/usr/local/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 127.0.0.1 20 80
->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refused->refusedmin:0.0400 avg:0.0475 max:0.1100 dev:0.0151 loss:0.0000
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

parameters supplied are wrong. This should look like

Code: Select all

ss_fping.php ss_fping <target> 20 TCP 80
for "pinging" against TCP Port 80
Reinhard
jordi
Posts: 7
Joined: Fri Apr 07, 2006 11:07 pm

Post by jordi »

lvm wrote:parameters supplied are wrong. This should look like

Code: Select all

ss_fping.php ss_fping <target> 20 TCP 80
for "pinging" against TCP Port 80
Reinhard
Thanks. It works:

Code: Select all

[root@linux cacti]# /usr/local/bin/php script_server.php
PHP Script Server has Started - Parent is cmd
/usr/local/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 127.0.0.1 20 TCP 80
min:0.3800 avg:0.6170 max:2.6000 dev:0.4702 loss:0.0000
quit
PHP Script Server Shutdown request received, exiting
But for ICMP, i still get the RED graphic showing 100% loss.
Attachments
untitled.JPG
untitled.JPG (29.47 KiB) Viewed 9544 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

ICMP Ping required root permissions. Personally, I don't recommend running the poller as root. AFAIK, latest cactid from svn should supply some workaround for that. But I haven't tried this yet
Reinhard
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

lvm wrote:ICMP Ping required root permissions. Personally, I don't recommend running the poller as root. AFAIK, latest cactid from svn should supply some workaround for that. But I haven't tried this yet
Reinhard
If I get any spare time, I am hoping to make a patch to use an external ping program as a workaround for this (on unix using fping). If I ever do have the time, I'll post it here.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
jordi
Posts: 7
Joined: Fri Apr 07, 2006 11:07 pm

Post by jordi »

lvm wrote:ICMP Ping required root permissions. Personally, I don't recommend running the poller as root. AFAIK, latest cactid from svn should supply some workaround for that. But I haven't tried this yet
Reinhard

Thanks so much.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests