forums.meulie.net

check_ping problems

I’m running nagios 1.2 on a gentoo system with a 2.6.11 kernel. The problem I’m having is that check_ping comes back as an unknown status and hosts get marked as either unknown or down.

please post the config of host check, service definition and command definition.
We can’t see what you defined because we don’t have access to your server :slight_smile:

define service{
name stroz-service
active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
check_period 24x7
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
max_check_attempts 5
normal_check_interval 1
retry_check_interval 1
contact_groups nagios-admins
notification_interval 60
notification_period 24x7
notification_options c,r
register 0
}

All Servers

define service{
use stroz-service
hostgroup_name all
service_description Ping
check_command check-host-alive
}

From the checkcommands.cfg:

define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100%
}

[quote=“3oz”]define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100%
}[/quote]

how is $USER1$ defined? does it point to the correct place?

what do you get when you run
check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100%
with real IP address?
Edited Thu Nov 17 2005, 08:46AM ]

$USER1$=/usr/nagios/libexec

securus ~ # /usr/nagios/libexec/check_ping -H 10.0.0.6 -w 3000.0,80% -c 5000.0,100%
PING OK - Packet loss = 0%, RTA = 0.27 ms

ls -la /usr/nagios/libexec/check_ping will most likely show that the nagios user doesn’t have permissions to this file.

All the check_* files in /usr/nagios/libexec/ are owned by nagios:nagios with 750 perms. I changed the perms to 755 just to be sure but it made no difference.

What did you use for the ./configure options? If you didn’t change anything, then it’s assumed the install will be in /usr/local/nagios and you are stating /usr/nagios. That might cause you trouble. Why did you have to deviate from the standard install dir?
Edited Thu Nov 17 2005, 12:26PM ]

I did not compile it by hand. I emerged it on gentoo. I’ve set up another nagios system from the same gentoo ebuild, which works fine. The only difference is the system with the problem is a 2.6 kernel and the working system is a 2.4 system.

Here’s what it says on the CGI page:

Current Status:
UNKNOWN
Status Information: /bin/ping -n -U -w 30 -c 5 10.0.1.6
Current Attempt: 5/5
State Type: HARD
Last Check Type: ACTIVE
Last Check Time: 11-17-2005 15:33:05
Status Data Age: 0d 0h 0m 49s
Next Scheduled Active Check: 11-17-2005 15:34:05
Latency: < 1 second
Check Duration: < 1 second
Last State Change: 11-16-2005 17:10:27
Current State Duration: 0d 22h 23m 27s
Last Service Notification: N/A
Current Notification Number: 0
Is This Service Flapping?
NO
Percent State Change: 0.00%
In Scheduled Downtime?
NO
Last Update: 11-17-2005 15:33:50

Try using the check_fping command instead or get a newer version of the check_ping command.

I tried check_fping which gave the same results. I then tried to as:

sudo -u nagios ./check_ping -H 10.0.0.6 -w 3000.0,80% -c 5000.0,100%

which gave me a warning although it worked as root. As it turns out, I had run Bastille on the system which blocked non-root users from using ping. In the end I ran:

chmod 4711 /bin/ping

And that fixed the problem. Thanks for all your help!

That’s very helpful, thanks.