Antwort: Re: Antwort: Re: $HOME is not set in init script

Arno Lehmann al at its-lehmann.de
Fri Jan 26 11:16:38 CET 2007


Hi,

On 1/26/2007 9:54 AM, TKocher at spirit21.de wrote:
> 
> Hi Danny,

I'm not Danny, but...

> in my further debugging, I recognized that something different is missing.
> 
> The whole stoy:
> 
> I wrote an event-handler which uses Expect to ssh to the faulty device. 
> ssh is not executed if I define the perl file as event-handler, but the 
> event-hander itself is executed.
> 
> If I write a bash script as event-handler, which embeddeds the perl 
> event-handler everything works fine:

You've got a problem with the perl script. The embedded Perl requires 
that you follow certain rules in your script. I suupose that there's the 
problem.

How to use ePn is documented somewhere - as I don't use it myself I 
don't have the URL here.

Arno

> #!/bin/bash
> /usr/local/nagios/libexec/eventhandlers/stop_pbr_webcomm.pl $1 $2 $3
> 
> In this case I removed the HOME assignment in the startup script and 
> reloaded nagios. Any Ideas?
> 
> Thorsten
> 
> -----Thorsten Kocher/Spirit21 schrieb: -----
> 
>     An: Daniel Meyer <eagle at cyberdelia.de>
>     Von: Thorsten Kocher/Spirit21
>     Datum: 26.01.2007 08:56AM
>     Kopie: Thorsten Kocher/Spirit21 at Spirit21,
>     nagios-users at lists.sourceforge.net
>     Thema: Antwort: Re: [Nagios-users] Antwort: Re: $HOME is not set in
>     init script
> 
>     Danny,
> 
>     you have the same start section as it is on my system.
>     If you look a little bit further in the file you find this section
> 
>     prefix=/usr
>     exec_prefix=/usr
>     NagiosBin=/usr/bin/nagios
>     NagiosCfgFile=/etc/nagios/nagios.cfg
>     NagiosStatusFile=/var/log/nagios/status.dat
>     NagiosTempFile=/var/log/nagios/nagios.tmp
>     NagiosRetentionFile=/var/log/nagios/retention.dat
>     NagiosCommandFile=/var/log/nagios/rw/nagios.cmd
>     NagiosVarDir=/var/log/nagios
>     NagiosRunFile=/var/run/nagios.pid
>     NagiosLockDir=/var/lock/subsys
>     NagiosLockFile=nagios
>     NagiosCGIDir=/usr/lib/nagios/cgi
>     NagiosUser=nagios
>     NagiosGroup=nagios
> 
>     # added by thorsten
> 
>     HOME=/var/log/nagios
> 
>     This solves the problem of the /home problem, so I before other
>     people are running in the same problem it is better to add it in the
>     distritbution.
> 
>     I am using Nagios 2.5 rpm for RH ES 3, updated to 2.7 with an rpm
>     build by my own.
> 
>     Thorsten
> 
> 
>         An: TKocher at spirit21.de
>         Von: Daniel Meyer <eagle at cyberdelia.de>
>         Datum: 26.01.2007 08:45AM
>         Kopie: nagios-users at lists.sourceforge.net
>         Thema: Re: [Nagios-users] Antwort: Re: $HOME is not set in init
>         script
> 
>         On Thu, 25 Jan 2007, TKocher at spirit21.de wrote:
> 
>          > Daniel,
>          >
>          > 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)
> 
>         Which distribution are you using? My init-script (based on the
>         one from
>         Dag Wieers Nagios-RPM) starts nagios this way:
> 
>         case "$1" in
> 
>                 start)
>                         echo "Starting network monitor: nagios"
>                         $NagiosBin -v $NagiosCfgFile > /dev/null 2>&1;
>                         if [ $? -eq 0 ]; then
>                                 su - $NagiosUser -c "/usr/bin/ndo2db -c
>         /etc/nagios/ndo2db.cfg"
>                                 su - $NagiosUser -c "touch
>         $NagiosVarDir/nagios.log $NagiosRetentionFile"
>                                 rm -f $NagiosCommandFile
>                                 touch $NagiosRunFile
>                                 chown $NagiosUser:$NagiosGroup
>         $NagiosRunFile
>                                 $NagiosBin -d $NagiosCfgFile
> 
> 
> 
>         Danny
>         -- 
>         Q: Gentoo is too hard to install      =        
>         http://www.cyberdelia.de <http://www.cyberdelia.de>
>            and I feel like whining.           =            
>         eagle at cyberdelia.de
>         A: Please see /dev/null.              =
>               (from the gentoo installer FAQ) =                        
>             \o/
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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

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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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