$HOME is not set correctly for plug-ins
Andreas Ericsson
ae at op5.se
Thu Nov 25 11:39:56 CET 2010
On 11/25/2010 12:12 AM, Alexander Haas wrote:
> Hi Jon,
>
> thank you for getting back on me. Of course I did do a su - nagios for
> my tests. I fact all my console tests run fine. I think it's Nagois
> doing some kind of su in its internals which causes my plug-in to get a
> wrong $HOME inherited. The bad behavior only occurs when executed by the
> actual Nagios setup.
>
Nagios just drops privileges. It doesn't handle parsing environment
variables already set by the user. And for all it knows, it could
be wrong if it tries to do so.
You could set whatever vars you want in /etc/sysconfig/nagios though
and have them work properly for every check Nagios runs. You can use
shell from there, so
HOME=~nagios
would be perfectly valid.
The /etc/sysconfig thing only works on reasonably recent versions of
Nagios btw, but setting the vars in the init-script would have much
the same effect.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
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