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
michaelwjoyner
Cacti User
Posts: 52
Joined: Wed Apr 08, 2009 12:24 pm

Post by michaelwjoyner »

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 34107 times
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Post by stormonts »

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

Post by tosick »

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

Post by srossen »

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

Post by jug »

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 8466 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 6431 times
srossen
Posts: 43
Joined: Mon Jun 13, 2005 1:10 pm

Post by srossen »

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?

Post by Jason.S »

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

Post by lard »

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 "

Post by ryusez »

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

Post by Johnny Lingo »

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

Post by Johnny Lingo »

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 29158 times
User avatar
Johnny Lingo
Posts: 28
Joined: Tue Feb 19, 2008 9:57 pm
Location: Silicon Valley, USA

Post by Johnny Lingo »

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 29103 times
freesk8ing
Posts: 1
Joined: Tue Mar 09, 2010 3:38 am

Post by freesk8ing »

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

Post by zorrosam »

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:

Post by Sem »

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

Who is online

Users browsing this forum: No registered users and 0 guests