sh: /check_ping: No such file or directory

Marc Powell marc at ena.com
Tue Oct 18 23:25:12 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Paul O'Rorke
> Sent: Tuesday, October 18, 2005 3:00 PM
> To: Nagios Users
> Subject: [Nagios-users] sh: /check_ping: No such file or directory
> 

[snip]

 
> After building Nagios and the plugins on **Fedora Core4 **with : (from
> the docs)
> 
> *    [root at nagios nagios-2.0b4]# ./configure
> --prefix=//usr/local/nagios/ --with-cgiurl=//nagios/cgi-bin/
> --with-htmurl=/nagios// --with-nagios-user=/nagios/
> --with-nagios-group=/nagios/ --with-command-group=/nagios

Might be related, might not but --with-nagios-user, --with-nagios-group
and --with-command-group are expecting usernames and groupnames, not
paths. The '/'s shouldn't be there.


> **Yet when I try to run with **:*
> *    /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg*
> **
> I get this :
> 
>     Nagios 2.0b4
>     Copyright (c) 1999-2005 Ethan Galstad (http://www.nagios.org)
>     Last Modified: 08-02-2005
>     License: GPL
> 
>     Nagios 2.0b4 starting... (PID=21936)
>     sh: /check_ping: No such file or directory
>     Warning: Return code of 127 for check of service 'PING' on host
> 'BEFVP41' was out of bounds. Make sure the plugin you're trying to run
> actually exists.
>     sh: /check_ping: No such file or directory
>     Warning: Attempting to execute the command "/check_ping -H
> 192.168.123.1 -w 3000.0,80% -c 5000.0,100% -p 1" resulted in a return
> code of 127.   Make sure the script or binary you are trying to
execute
> actually exists...

Without seeing any of your configuration, my guess would be that the
command{} definition referenced by the service PING on BEFVP41 either
doesn't have the full correct path to the check_ping command or doesn't
use the $USER1$ macro as a substitute. For example, the following are
equivalent if $USER1$ is defined as '/usr/local/nagios/libexec' in
resource.cfg --

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

define command{
        command_name    check-host-alive
        command_line    /usr/local/nagios/libexec/check_ping
$HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
        }

My guess is that you have something similar to the following which
nagios is properly treating as the full path to the plugin from / --

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

> I wonder in which config file the path to the plugins specified?  Is
it

resource.cfg and defaults to using the $USER1$ with a path of
'/usr/local/nagios/libexec'.

[snip]

> (usr/local/nagios/share) - just the CGIs.  The CGIs are in
> /usr/local/nagios/sbin and all have 776 permissions, owner nagios,
group
> nagios.
> 
> from /var/log/httpd/error.log:
>     [Tue Oct 18 07:43:07 2005] [error] [client 192.168.123.120]
> (13)Permission denied: exec of '/usr/local/nagios/sbin/tac.cgi'
failed,
> referer: http://nagios.paulororke.net/nagios/side.html
>     [Tue Oct 18 07:43:07 2005] [error] [client 192.168.123.120]
> Premature end of script headers: tac.cgi, referer:
> http://nagios.paulororke.net/nagios/side.html
> 
> 
> Any suggestions anyone?

This is almost certainly your SELinux policy not allowing access. There
are several posts in the archive related to this and this specific issue
was even discussed today.

--
Marc


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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