EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6g

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

Moderators: Moderators, Developers

Post Reply
Author
Message
michaelwjoyner
Cacti User
Posts: 52
Joined: Wed Apr 08, 2009 12:24 pm

#406 Post by michaelwjoyner » Wed Apr 22, 2009 5:24 pm

I am getting some wierd poller issues.

Basically, I have the most recent version.

1) I added the LAST on my RRA's as a default
2) I added the missing include global.php in ss_fping.php

For alot of hosts----- its working great. But every once and a while I am getting some wierd poller issues. SEE IMAGE.

My poller is starting to run out of time too...... its maxing out at 298 seconds for example.
Attachments
ScreenHunter_04 Apr. 22 14.48.gif
ScreenHunter_04 Apr. 22 14.48.gif (22.91 KiB) Viewed 26612 times

stormonts
Cacti User
Posts: 294
Joined: Tue Mar 31, 2009 10:05 am

#407 Post by stormonts » Wed Jun 03, 2009 7:39 pm

Trying to get this running on .8.7d, and I get this when I run the command from the poller:

PHP Fatal error: Call to undefined function read_config_option() in /usr/local/cacti-0.8.7b/scripts/ss_fping.php on line 38

PHP is installed and running fine as we have other PHP scripts that are working. Any suggestions? This is on SLES 10 SP2 with PHP 5.2.5.

tosick
Posts: 2
Joined: Thu Aug 13, 2009 5:38 am

Graphs empty

#408 Post by tosick » Fri Aug 14, 2009 5:50 am

I'm install Advanced Ping on my cacti but my Graphics is empty and latency is NAN. What's wrong? Please, help.

srossen
Posts: 43
Joined: Mon Jun 13, 2005 1:10 pm

#409 Post by srossen » Tue Sep 15, 2009 7:36 am

on 0.8.7e I imported this and get this error in debug mode of the graph:

ERROR: the RRD does not contain an RRA matching the chosen CF


I can't figure out what CF is missing. Any ideas?

jug
Posts: 4
Joined: Fri Oct 10, 2008 5:20 am
Location: Italy

#410 Post by jug » Wed Sep 23, 2009 5:15 am

Hello,

this are the new templates for cacti version 0.8.7 as there some basic things changed and old scripts and templates won't work anymore :-?

As andreagabellini told us in his post (thanks for your explanation) on new installation MIN and LAST CF's are not created by default. As the Graph-Template used this CF's you got error on creating the Graph.

I include in this post the new version of ss_fping.php (including now the requested global.php instead of the config.php) and the modified Graphtemplate which now does *not* use LAST and MIN but only AVERAGE and MAX.

Hope this works again for all of you.

Have fun,

Jug
Attachments
cacti_graph_template_ping_advanced_ping_v2_2.xml
Cacti Template for Advanced PING for cacti version 0.8.7. Import this from your cacti web frontend.
(42.42 KiB) Downloaded 7646 times
ss_fping.zip
Modified php file ss_fping.php which now includes global.php instead of config.php. Unzip this and put it into the scripts directory of your installation.
(1.56 KiB) Downloaded 5844 times

srossen
Posts: 43
Joined: Mon Jun 13, 2005 1:10 pm

#411 Post by srossen » Thu Oct 01, 2009 2:03 pm

Just wanted to let you know I installed 2.2 and it works fine with 0.8.7e for me. Thanks!

Jason.S
Posts: 35
Joined: Thu Jun 11, 2009 9:28 am

Ping and Adv Ping side by side?

#412 Post by Jason.S » Wed Oct 07, 2009 11:24 am

Hello....

Can we use both Ping and Adv Ping on the same box? When I try, all my normal ping graphs will stop working and Adv Ping will start working. I would love to have both without having to blow away my ping graph everytime I try Adv Ping.


Jason

User avatar
lard
Cacti User
Posts: 165
Joined: Wed Jul 20, 2005 10:48 am
Location: UK - Cambridge

#413 Post by lard » Tue Oct 20, 2009 3:53 am

srossen wrote:Just wanted to let you know I installed 2.2 and it works fine with 0.8.7e for me. Thanks!
Same here - upgraded from 0.8.7d > 0.9.7e and PA 2.5 and all working well, thanks :)
---- lard007skype ----

ryusez
Posts: 25
Joined: Thu Sep 28, 2006 9:36 pm

Can adding a function, " bind a local ip "

#414 Post by ryusez » Fri Dec 04, 2009 10:34 pm

dear sir

can adding one function . can be bind a local IP ..

if cacti pc have multiple ip . can be assing one ip to ping ...

User avatar
Johnny Lingo
Posts: 28
Joined: Tue Feb 19, 2008 9:57 pm
Location: Silicon Valley, USA

#415 Post by Johnny Lingo » Mon Feb 01, 2010 7:51 pm

Hmm....seems to run just fine from Script Server, but my graphs always show 100% packet loss.

I'm running Cacti 0.8.7e

User avatar
Johnny Lingo
Posts: 28
Joined: Tue Feb 19, 2008 9:57 pm
Location: Silicon Valley, USA

#416 Post by Johnny Lingo » Mon Feb 01, 2010 7:57 pm

Script Server output looks good:

Code: Select all

> php /home/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
/home/cacti/scripts/ss_fping.php ss_fping myrouter.example.com 10 ICMP
min:27.7970 avg:29.8557 max:34.0310 dev:1.6493 loss:0.0000
But graph shows 100% packet loss
Attachments
graph_image.php.png
graph_image.php.png (5.56 KiB) Viewed 22164 times

User avatar
Johnny Lingo
Posts: 28
Joined: Tue Feb 19, 2008 9:57 pm
Location: Silicon Valley, USA

#417 Post by Johnny Lingo » Tue Feb 02, 2010 2:25 pm

Hmm...so I tried switching to UDP and TCP ping rather than ICMP. UDP showed a 60% packet loss, but TCP worked just great.

It's still a mystery why it worked just fine from the CLI. My guess is it was some type of network I/O issue, and ICMP and UDP ping had problems when run at the same as Cacti polling.
Attachments
graph_image.php.png
graph_image.php.png (6.17 KiB) Viewed 22109 times

freesk8ing
Posts: 1
Joined: Tue Mar 09, 2010 3:38 am

#418 Post by freesk8ing » Tue Mar 09, 2010 3:43 am

hi!
If I want to monitor multi ports in one host,
can Advanced Ping do this?How?

User avatar
zorrosam
Cacti User
Posts: 244
Joined: Thu May 03, 2007 3:17 pm
Location: Italy

problem with ICMP. Please help me

#419 Post by zorrosam » Wed Mar 24, 2010 12:06 pm

giulioharding wrote:
TheWitness wrote:If you are running UNIX, the script_server has to have rights to create a RAW socket (aka root or asroot). Otherwise use something like "TCP 80" or something similar. Windows does not care.

TheWitness

I noticed that a lot of people have had this 'Operation not permitted' problem using ICMP pings on Linux - I've had the same problem, and despite a lot of research, couldn't find any suggestions on how to fix it.

The issue, in my case, is that the gateway I wish to ping, to monitor our internet link, only responds to ICMP pings - there are no TCP/UDP ports open for me to use, so that rules out using those protocols as a work-around. I need ICMP, therefore, cacti needs elevated priveleges somehow.

I don't want to run cacti in it's entirety as root, so in the absence of any other ideas, or knowledge of the cacti script mechanism, or PHP, I hacked up a little modification to the ss_fping.php script, using sudo to give it elevated privileges :)

It's ugly, but it works - in case anyone else might find this handy, here's the summary of the changes I made: (Cacti 0.8.6g, up-to-date Fedora Core 4 install)

1.) Install sudo if you haven't got it already, and add the following lines to /etc/sudoers: (you may need to change 'cacti' to whatever user is running the poller)

# Allow cacti user to run ping script with elevated privileges (so it can send ICMP pings)
cacti ALL=NOPASSWD: /usr/bin/php /var/www/cacti/scripts/ss_fping_exec.php [0-9a-zA-Z]*

2.) Rename ss_fping.php to ss_fping_exec.php

3.) Create a new ss_fping.php with the following code snippet (ripped from ss_fping.php) - change the ''/var/www/cacti/" reference to match the path to your cacti installation.

<?php
#!/usr/bin/php -q

//STANDARD SCRIPT SERVER HEADER!!!
$no_http_headers = true;

/* display No errors */
error_reporting(E_ERROR);

if (!isset($called_by_script_server)) {
array_shift($_SERVER["argv"]);
print call_user_func_array("ss_fping", $_SERVER["argv"]);
}
//End header.

function ss_fping($hostname, $ping_sweeps=6, $ping_type="ICMP", $port=80) {
return exec('sudo /usr/bin/php /var/www/cacti/scripts/ss_fping_exec.php '.$hostname.' '.$ping_sweeps.' '.$ping_type.' '.$port);
}
?>

4.) That's it! (I think :) The ss_fping.php wrapper script should now invoke the real ss_fping script using sudo, without requiring a password, allowing ICMP pings to be sent without running anything else as root.

This isn't ideal, from a security point of view (I haven't looked over the ss_fping script to see if the root privileges could be exploited somehow by passing bogus parameter values), but it works, so I'm happy enough :)

If anyone wants to make any suggestions, or point out some horrid mistake I've made, please do so!
guys.

I have implemented this workaround.

All is working through cli, with root and cacti user.

The problem is that from Cacti the output is this.

03/24/2010 06:00:13 PM - CMDPHP: Poller[0] Host[1329] DS[253] SERVER: /var/www/cacti/scripts/ss_fping.php ss_fping ixlfsMICES01 20 ICMP , output: U

The path of the data input is the original of the template.

<path_cacti>/scripts/ss_fping.php ss_fping <hostname> <attempts> <protocol> <port>

The graphs are not updated, like rra of each graphs.

The version of my cacti is 0.87d.

I have tried to import the last xml 2.2 .. but i obtain this error :

Error: XML: Hash version does not exist.

please help me
zorro

Sem
Posts: 29
Joined: Fri Mar 25, 2005 3:05 am
Contact:

#420 Post by Sem » Thu May 20, 2010 11:41 am

Johnny Lingo wrote:Script Server output looks good:

Code: Select all

> php /home/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
/home/cacti/scripts/ss_fping.php ss_fping myrouter.example.com 10 ICMP
min:27.7970 avg:29.8557 max:34.0310 dev:1.6493 loss:0.0000
But graph shows 100% packet loss
The same problem here. Works fine from command line:
% sudo -u cacti -s
> php ss_fping.php myhost 10 ICMP
min:1.3740 avg:1.5888 max:1.6370 dev:0.0961 loss:0.0000>

But draws 100% loss.

Post Reply