Problems with perl script (ping)
Moderators: Developers, Moderators
Problems with perl script (ping)
Hello,
Today I upgrade from 0.85a to 0.86 and I still have problems with the perl script ping.pl.
In 0.85a it doesn't work but now in 0.86 it give the following error when I run poller.php
-----------------------8<-------------------------------
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
[-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
[-M mtu discovery hint] [-S sndbuf]
[ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
-----------------------8<-------------------------------
What I think that's the problem is, is that the <ip> variable what is given by data_input-methods (perl <path_cacti>/scripts/ping.pl <ip>) not is given to the ping.pl script.
When I start the ping.pl script on the shell-prompt it works correctly.
Is this a known problem?
Dave
Today I upgrade from 0.85a to 0.86 and I still have problems with the perl script ping.pl.
In 0.85a it doesn't work but now in 0.86 it give the following error when I run poller.php
-----------------------8<-------------------------------
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
[-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
[-M mtu discovery hint] [-S sndbuf]
[ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
-----------------------8<-------------------------------
What I think that's the problem is, is that the <ip> variable what is given by data_input-methods (perl <path_cacti>/scripts/ping.pl <ip>) not is given to the ping.pl script.
When I start the ping.pl script on the shell-prompt it works correctly.
Is this a known problem?
Dave
Hello,
Today i downloaded cacti-0.8.6b and installed it on a Suse 9.1 Linux system.
On this server I got the same problem with the Unixping script.
When I start poller.php:
php /home/websites/www.deefje.net/html/beheer/cacti-0.8.6b/poller.php
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
[-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
[-M mtu discovery hint] [-S sndbuf]
[ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
OK u:0.00 s:0.00 r:1.02
OK u:0.00 s:0.00 r:1.02
OK u:0.00 s:0.00 r:1.02
etc...
I think the variable is not comming with the command.
Does someone else has this problem.
Dave
Today i downloaded cacti-0.8.6b and installed it on a Suse 9.1 Linux system.
On this server I got the same problem with the Unixping script.
When I start poller.php:
php /home/websites/www.deefje.net/html/beheer/cacti-0.8.6b/poller.php
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
[-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
[-M mtu discovery hint] [-S sndbuf]
[ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
OK u:0.00 s:0.00 r:1.02
OK u:0.00 s:0.00 r:1.02
OK u:0.00 s:0.00 r:1.02
etc...
I think the variable is not comming with the command.
Does someone else has this problem.
Dave
You can confirm that suspicion. Open up the poller cache by going to System Utilities -> View Poller Cache. Now search in your browser for "ping.pl". You should see the specific item being executed by the poller including the full script patch with arguments. Report back what the script path says and we can work from there.Deefje wrote:By input string: perl <path_cacti>/scripts/ping.pl <ip> the variable <ip> isn't working.
-Ian
Rax,
This is what I saw in the poller cache:
----------------------------8<------------------------------------------
Data Source: Core-2 - Ping Host
RRD: /usr/local/httpd/htdocs/cacti-0.8.6a/rra/core2_ping_145.rrd
Action: 1, Script: perl /usr/local/httpd/htdocs/cacti-0.8.6a/scripts/ping.pl
----------------------------8<------------------------------------------
Dave
This is what I saw in the poller cache:
----------------------------8<------------------------------------------
Data Source: Core-2 - Ping Host
RRD: /usr/local/httpd/htdocs/cacti-0.8.6a/rra/core2_ping_145.rrd
Action: 1, Script: perl /usr/local/httpd/htdocs/cacti-0.8.6a/scripts/ping.pl
----------------------------8<------------------------------------------
Dave
It looks as if the parameter is not passed to the script.
Could you modify it to output the value that is passed to the script?
And post the debug output ?
Could you modify it to output the value that is passed to the script?
Code: Select all
#!/usr/bin/perl
print $ARGV[0] . "\n";
$ping = `ping -c 1 $ARGV[0] | grep icmp_seq`;
$ping =~ m/(.*time=)(.*) (ms|usec)/;
print $2;
--
Regardz,
BWare
Regardz,
BWare
Also if you used the "Unix - Ping Host" graph template to create this graph, you can see exactly which IP address should be passed to the script. Go to Data Sources, select the device in question and choose the data source with a template name of "Unix - Ping Host". What is listed for the "IP Address" under "Custom Data"?
-Ian
-Ian
Looks like I made a mistake when creating the "Unix - Ping Host" data template. The IP address is supposed to be derived from the device. To fix, go to "Data Templates", select "Unix - Ping Host", and uncheck "Use Per-Data Source Value" for the "IP Address" field. Now when you create a new ping graph through "New Graphs", this field will be handled automatically.
I also corrected the problem in the default template that will be included in the cacti.sql for subsequent versions of Cacti.
-Ian
I also corrected the problem in the default template that will be included in the cacti.sql for subsequent versions of Cacti.
-Ian
Who is online
Users browsing this forum: No registered users and 0 guests