Nagios specific scripts and/or binaries

Arno Lehmann al at its-lehmann.de
Mon Mar 27 13:38:49 CEST 2006


Hi,

On 3/27/2006 10:57 AM, George Rushby wrote:
> Please excuse my ignorance but the PATH setting for Nagios?!

Yes, the search path for executables. In other words, perhaps neither 
/usr/local/bin nor /opt/tools/pipesend are used to search for programs.

The PATH is, usually and IIRC, set in the start script for nagios or 
inherited from the existing environment.

The most useful thing you might do is simply use all commands with a 
full path - that avoids some security holes as well.

Arno

> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net
> [mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Arno Lehmann
> Sent: 24 March 2006 09:06 PM
> To: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Nagios specific scripts and/or binaries
> 
> Hello,
> 
> please send replies to the list and don't request a read confirmation...
> 
> On 3/24/2006 7:30 PM, George Rushby wrote:
> 
>>HI Arno,
>>
>>Thanks for your prompt response! 
>>
>>I have been doing all test work running as the nagios user. If I take the
>>following command "/usr/bin/printf "***** Nagios  *****\n\nNotification
>>Type: PROBLEM\n\nService: Current Users\nHost: test-server\nIP:
>>10.0.0.200\nState: WARNING\nDate/Time: Fri Mar 24 18:44:56 SAST
>>2006\n\nAdditional Info:\n\nUSERS WARNING - 1 users currently logged in" |
>>/opt/tools/pipesend/pipesend" it works like a dream.
>>
>>I have even created a symbolic link for pipesend in /usr/local/bin.....but
>>alas it fails!
> 
> 
> PATH setting for Nagios, perhaps? And I don't mean the one you get as 
> user nagios, I mean the one Nagios works with...
> 
> Apart from that, for that sort of problem, it's a simple thing to write 
> a small wrapper script which logs some diagnostic output - for example, 
> path, id, shell and probably the Nagios-specific environment variables - 
> and then submits the actual program calls with parameters. You might 
> even log things like the output from 'which <programname>' and '/bin/ls 
> -l <programname>' to see what actually happens...
> 
> Arno
> 
> 
>>Anymore help would be appreciated.
>>
>>George
>>
>>-----Original Message-----
>>From: nagios-users-admin at lists.sourceforge.net
>>[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Arno
> 
> Lehmann
> 
>>Sent: 24 March 2006 08:21 PM
>>To: nagios-users at lists.sourceforge.net
>>Subject: Re: [Nagios-users] Nagios specific scripts and/or binaries
>>
>>Hi,
>>
>>On 3/24/2006 7:11 PM, George Rushby wrote:
>>...
>>
>>
>>>I get the following error in the nagios.log file
>>>
>>>
>>>
>>>[1143218696] SERVICE NOTIFICATION: george;test-server;Current 
>>>Users;WARNING;notify-by-sms;USERS WARNING - 1 users currently logged in
>>>
>>>[1143218696] Warning: Attempting to execute the command "/usr/bin/printf 
>>>"***** Nagios  *****\n\nNotification Type: PROBLEM\n\nService: Current 
>>>Users\nHost: test-server\nIP: 10.0.0.200\nState: WARNING\nDate/Time: Fri 
>>>Mar 24 18:44:56 SAST 2006\n\nAdditional Info:\n\nUSERS WARNING - 1 users 
>>>currently logged in" | pipesend" resulted in a return code of 127.  Make 
>>>sure the script or binary you are trying to execute actually exists...
>>>
>>
>>...
>>
>>
>>>If I remove the ‘pipesend’ and replace it with ‘mail’ and execute it via 
>>>Nagios it works.
>>>
>>>
>>>
>>>So the question is, does Nagios only work with special scripts and/or 
>>>binaries?
>>>
>>
>>
>>PATH or permissions.
>>
>>I'm quite sure that your script either can not be found in Nagios' 
>>search path, or that Nagios can't run it due to missing permissions.
>>
>>You should keep in mind that all test work should be done as the user 
>>Nagios runs as.
>>
>>Arno
>>
>>
>>
>>>Thanks in advance
>>>
>>>George
>>>
>>>
>>>--
>>>No virus found in this outgoing message.
>>>Checked by AVG Free Edition.
>>>Version: 7.1.385 / Virus Database: 268.3.0/290 - Release Date: 2006/03/23
>>>
>>
>>
> 

-- 
IT-Service Lehmann                    al at its-lehmann.de
Arno Lehmann                  http://www.its-lehmann.de



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
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