Re: [Nagios-users] $HOME is not set correctly for plug-ins

2010-11-25 Thread Andreas Ericsson
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.

Re: [Nagios-users] $HOME is not set correctly for plug-ins

2010-11-25 Thread Alexander Haas
On 25.11.2010 11:39, Andreas Ericsson wrote: On 11/25/2010 12:12 AM, Alexander Haas wrote: 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

Re: [Nagios-users] $HOME is not set correctly for plug-ins

2010-11-25 Thread Andreas Ericsson
On 11/25/2010 09:18 PM, Alexander Haas wrote: On 25.11.2010 11:39, Andreas Ericsson wrote: On 11/25/2010 12:12 AM, Alexander Haas wrote: 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

[Nagios-users] $HOME is not set correctly for plug-ins

2010-11-24 Thread Alexander Haas
Hi Nagios users, this is my first post. I encountered a behavior I am not able to understand. Well, I guess I did understand it, but I don't know how to counter it :) When I write a plug-in for Nagios it is executed as nagios:nagios. Yet $HOME is set to /root. My /etc/password and nagios's

Re: [Nagios-users] $HOME is not set correctly for plug-ins

2010-11-24 Thread Jon Adcock
Alexander, It sounds like you are saying that you login as root, then su to nagios. If that's the case, make sure that you use su - nagios The hyphen tells su to use the environmental variables of the user that you are switching to. Without using the hyphen, it continues to use the

Re: [Nagios-users] $HOME is not set correctly for plug-ins

2010-11-24 Thread Alexander Haas
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