[Nagiosplug-devel] [ nagiosplug-Bugs-946857 ] check_ping - output error

SourceForge.net noreply at sourceforge.net
Sat Nov 20 14:28:02 CET 2004


Bugs item #946857, was opened at 2004-05-03 03:05
Message generated for change (Comment added) made by mattkent
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=946857&group_id=29880

Category: Argument proccessing
Group: Release (specify)
>Status: Pending
Resolution: None
Priority: 5
Submitted By: Pumuckel1980 (pumuckel1980)
>Assigned to: Matthew Kent (mattkent)
Summary: check_ping - output error

Initial Comment:
Hello,

I have some problems with the "nagios-plugins-
1.4.0alpha1". In this Version the check_ping plugin show 
me the following result:
"bin/ping -n -U -c 1 ntest2ext
Error: Could not interpret output from ping command"

It's OK when I use the "nagios-plugins-1.3.1.tar.gz".


./check_ping -H ntest2ext -w 3000.0,80% -c 
5000.0,100% -p 1 PING OK - Packet loss = 0%, RTA = 
0.22 ms
PING OK - Packet loss = 0%, RTA = 0.46 ms


Here are my differnet settings:

1.
nagios-plugins-1.3.1.tar.gz
##############################
= uname -a
"Linux *HOSTNAME* 2.4.22 #1 SMP Mit Okt 29 15:21:08 
CET 2003 i686 i686 i386 GNU/Linux"

=./check_ping -H *HOSTNAME* -w 3000.0,80% -c 
5000.0,100% -p 1 
"PING OK - Packet loss = 0%, RTA = 0.22 ms
PING OK - Packet loss = 0%, RTA = 0.48 ms"

2. 
"nagios-plugins-1.4.0alpha1"
##############################
= uname -a
"Linux *HOSTNAME* 2.4.22 #1 SMP Mit Okt 29 1:21:08 
CET 2003 i686 i686 i386 GNU/Linux"

=./check_ping -H ntest2ext -w 3000.0,80% -c 
5000.0,100% -p 1
"/bin/ping -n -U -c 1 ntest2ext
Error: Could not interpret output from ping command"


thanks for help
bye

----------------------------------------------------------------------

>Comment By: Matthew Kent (mattkent)
Date: 2004-11-20 14:27

Message:
Logged In: YES 
user_id=983566

Okay thank you for the output. I've added a case to
hopefully catch it in cvs HEAD. 

Would you be able to download the latest version and test?

----------------------------------------------------------------------

Comment By: Patrick Lynch (plynch)
Date: 2004-07-23 08:53

Message:
Logged In: YES 
user_id=375667

I have created a patch for this in Redhat ES 3.0.  The
reported output from ping changed ever so slightly and was
breaking when the host was down.   Here is the patch.  The
work 'packet' is no longer shown in the errors output field.


------ Begin check_ping.c patch for RedHat ES 3.0 -------

--- plugins/check_ping.c        2003-01-13
07:15:16.000000000 -0500
+++ plugins/check_ping.c.new    2004-07-23
10:32:56.000000000 -0500
@@ -387,6 +387,9 @@
                                        (input_buffer, "%*d
packets transmitted, %*d packets received, +%*d errors, %d%%
packet loss",
                                                 &pl) == 1
                                || sscanf 
+                                       (input_buffer, "%*d
packets transmitted, %*d received, +%*d errors, %d%% packet
loss",
+                                                &pl) == 1
+                               || sscanf 
                                        (input_buffer, "%*d
packets transmitted, %*d packets received, %d%% packet loss",
                                                &pl) == 1
                                || sscanf 



------ End check_ping.c patch for RedHat ES 3.0 -------



----------------------------------------------------------------------

Comment By: Alex Burger (alex_b)
Date: 2004-06-30 19:20

Message:
Logged In: YES 
user_id=85836

My testing was with Mandrake 10, not 9.2.  10 seems to have
a different output for ping.  Patch 912996 should help with
the output problem, but it won't help with the STDOUT/ERR
problem.

----------------------------------------------------------------------

Comment By: Alex Burger (alex_b)
Date: 2004-06-30 19:03

Message:
Logged In: YES 
user_id=85836


I am using Nagios-1.2 with nagios-plugins-1.3.1 and I am
having a similar problem.

On my Mandrake 9.2 system, host notifications for DOWN are
showing the command line instead of the plugin output
although the output for UP is correct.  For example:

[1088427108] HOST ALERT: server01;DOWN;SOFT;1;/bin/ping -n
-U -c 1 server01
[1088427135] HOST NOTIFICATION:
alex;server01;DOWN;host-notify-by-email;/bin/ping -n -U -c 1
server01
[1088427305] HOST NOTIFICATION:
alex;server01;UP;host-notify-by-email;PING OK - Packet loss
= 0%, RTA = 0.28 ms

The host is using 'check-host-alive' which uses the
following command line:

/usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w
5000,100% -c 5000,100% -p 1

It looks like check_ping is expecting the 'From 10.36.39.219
icmp_seq=1 Destination Host Unreachable' message to be sent
to STDERR from ping, but on my system it goes to STDOUT.

To test, I created a script that outputs to STDERR a ping
result, and changed check_ping to call my script instead:

#!/usr/bin/perl
select STDERR;
print "From 192.168.1.1 icmp_seq=1 Destination Host
Unreachable\n";
print "\n";
print "--- 192.168.1.1 ping statistics ---\n";
print "echo 1 packets transmitted, 0 received, +1 errors,
100% packet loss, time 0ms\n";

Calling check_ping, I get the correct output:

PING CRITICAL - Host Unreachable

If I changed the script by removing 'select STDERR', I get:

Error: Could not interpret output from ping command

Looking at the source code, if it can not interpret the
output it outputs the command that was executed instead, for
troubleshooting purposes I assume.

Alex



----------------------------------------------------------------------

Comment By: Pumuckel1980 (pumuckel1980)
Date: 2004-05-03 05:18

Message:
Logged In: YES 
user_id=1034118

added:

here is the output of the ping command:
[root at pb3 nagios-plugins-1.4.0alpha1]# /bin/ping -n -U -c 1 
192.168.1.3
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
64 bytes from 192.168.1.3: icmp_seq=1 ttl=255 time=0.243 ms

--- 192.168.1.3 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.243/0.243/0.243/0.000 ms


At the moment I've test the CVS Version (1.27) of the 
check_ping command. With this there is the same error like in 
the "nagios-plugins-1.4.0alpha1" package.

thanks
bye

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=946857&group_id=29880




More information about the Devel mailing list