Help - I am unable to get the NSClient++to restart services

Marc Powell marc at ena.com
Thu Jul 17 21:24:24 CEST 2008


On Jul 17, 2008, at 2:06 PM, Jonathan Williams wrote:

> That is my guess as well, but the user Nagios is the owner of the  
> file.

Ownership doesn't matter at all except in very special circumstances  
(suid bit is set).
> \
> Warning: Attempting to execute the command
> "/usr/local/nagios/libexec/send_mail.pl - n "Service Problem" -h
> "jwilliamspc" -s "Critical"... (all the parameters are correct)...
> jonathan.williams at us.g4s.com resulted in a return code of 126.  Make
> sure the script or binary you are trying to execute actually exists...
>
> I did some searching on error code 126 and the issue was permission,  
> but
> if Nagios is the owner how could that be?

126 means that the program you are trying to execute doesn't exist.  
Looking at the script, send_mail.pl is just a fancy wrapper for /usr/ 
sbin/sendmail. It also calls /usr/bin/printf, uuencode (no specific  
path referenced), and the date command (again, no path referenced).  
All of those programs must exist in the paths specified or your should  
change the paths in the script. send_mail.pl must also exist in /usr/ 
local/nagios/libexec.  I would also modify the script to explicitly  
include the path to uuencode and date. When nagios executes the  
script, most of the $ENVIRONMENT variables don't exist or are  
different than when executed manually, including $PATH.

--
Marc

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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