EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6g
Moderators: Developers, Moderators
-
- Cacti User
- Posts: 52
- Joined: Wed Apr 08, 2009 12: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.
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 (22.91 KiB) Viewed 33889 times
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.
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.
Graphs empty
I'm install Advanced Ping on my cacti but my Graphics is empty and latency is NAN. What's wrong? Please, help.
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
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 8420 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 6364 times
Ping and Adv Ping side by side?
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
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
Can adding a function, " bind a local ip "
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 ...
can adding one function . can be bind a local IP ..
if cacti pc have multiple ip . can be assing one ip to ping ...
- Johnny Lingo
- Posts: 28
- Joined: Tue Feb 19, 2008 9:57 pm
- Location: Silicon Valley, USA
- Johnny Lingo
- Posts: 28
- Joined: Tue Feb 19, 2008 9:57 pm
- Location: Silicon Valley, USA
Script Server output looks good:
But graph shows 100% packet loss
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
- Attachments
-
- graph_image.php.png (5.56 KiB) Viewed 28940 times
- Johnny Lingo
- Posts: 28
- Joined: Tue Feb 19, 2008 9:57 pm
- Location: Silicon Valley, USA
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.
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 (6.17 KiB) Viewed 28885 times
-
- Posts: 1
- Joined: Tue Mar 09, 2010 3:38 am
problem with ICMP. Please help me
guys.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!
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
The same problem here. Works fine from command line:Johnny Lingo wrote:Script Server output looks good:
But graph shows 100% packet lossCode: 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
% 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.
Who is online
Users browsing this forum: No registered users and 0 guests