<FONT face="Vorgabe Sans Serif,Verdana,Arial,Helvetica,Sans-serif" size=2><div>Daniel,<br><br>nagios is started in /etc/init.d/nagios with "su - nagios -c nagios", so the process inherits the environment varialbes of the root user, which executes the su command. ($HOME is /root)<br>so the ssh wants to open ~/.ssh/known_hosts which is /root/.ssh/known_hosts which is not readable by the nagios user.<br><br>If you look into /etc/init.d/nagios a lot of environment varialbes are set, it is no big deal to set in addition the $HOME variable.<br><br>Thorsten<br><div><font color="#990099"><br></font><blockquote style="border-left: 2px solid #000000; padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">An: TKocher@spirit21.de<br>Von: Daniel Meyer <eagle@cyberdelia.de><br>Datum: 25.01.2007 02:54PM<br>Kopie: nagios-users@lists.sourceforge.net<br>Thema: Re: [Nagios-users] $HOME is not set in init script<br><br><font face="monospace" size="3">On Thu, 25 Jan 2007, TKocher@spirit21.de wrote:<br><br>> I was writing an event-handler which does ssh to the faulty box. It does not work at<br>> all, since $HOME was /root and not /var/log. ssh aborted since it could not read<br>> /root/.ssh/known_hosts.<br>> <br>> So please change the /etc/init.d/nagios which sets all environment variable.<br><br>Well, its not the init script, its /etc/passwd...<br><br>nagios:x:100:101:nagios:/var/log/nagios:/bin/sh<br><br>But why should the nagios user be able to read files within roots home <br>directory? Let the nagios user use its own .ssh/known_hosts file...<br><br>Danny<br>-- <br>Q: Gentoo is too hard to install      =        <a href="http://www.cyberdelia.de">http://www.cyberdelia.de</a><br>    and I feel like whining.           =             eagle@cyberdelia.de<br>A: Please see /dev/null.              =<br>       (from the gentoo installer FAQ) =                             \o/<br></font>
</blockquote><br></div></div></FONT>