Host DOWN alerts not passing pluging output

Alex Burger alex at fragit.net
Mon Jun 28 20:56:44 CEST 2004


Bruce Elrick wrote:

> Alex Burger wrote:
> 
>> For some reason my host notifications for DOWN are showing the command 
>> line instead of the plugin output although the output for UP is 
>> correct, which seems strange.
>>
>> [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
>>
>> If I run the above command manually when the server is up, I get:
>>
>> PING OK - Packet loss = 0%, RTA = 0.28 ms
>>
>> Anyone have this problem?
>>
>> I am using Nagios-1.2 with nagios-plugins-1.3.1.
> 
> 
> I've seen that too with the ping check.  Haven't pursued the cause yet.  
> That's with nagios 1.1 and plugins 1.3.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:

PING CRITICAL - Host Unreachable

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

Error: Could not interpret output from ping command

Alex



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list