<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Re: [Nagios-users] nagios + chroot: Return code of 127 for check of service</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>No, its nagios. 127 means nagios could not find or execute the plugin. Verify the paths in command.cfg make sense in you're chroot environment.<BR>
<BR>
<BR>
--<BR>
Marc<BR>
<BR>
Sent from a very tiny wireless device with a very tiny unlit keyboard.<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: julien Touche <julien.touche@lycos.com><BR>
To: nagios-users@lists.sourceforge.net <nagios-users@lists.sourceforge.net><BR>
Sent: Sat May 17 02:50:53 2003<BR>
Subject: [Nagios-users] nagios + chroot: Return code of 127 for check of service<BR>
<BR>
<BR>
Hi<BR>
<BR>
i finally manage to get nagios working in apache chroot but i get tons<BR>
of warning:  Return code of 127 for check of service 'XXX' ...<BR>
and all the rest works quite right.<BR>
i ask myself if it is the cgis which make this check or the daemon ?<BR>
<BR>
<BR>
Regards<BR>
<BR>
                Julien<BR>
<BR>
here my little script to install in chroot<BR>
<BR>
<<<<BR>
prefix=/opt/nagios<BR>
chrootprefix=/var/www<BR>
chrootdir=$chrootprefix/htdocs/admin/nagios<BR>
tmp=`mktemp /tmp/tmp.XXXXXX` || exit 1<BR>
<BR>
args="--with-gd-lib=/usr/local/lib --with-gd-inc=/usr/local/include"<BR>
<BR>
./configure --prefix=$prefix --sbindir=$chrootdir/sbin<BR>
--datadir=$chrootdir/share --with-htmurl=/admin/nagios<BR>
--with-cgiurl=/admin/nagios/cgi-bin --sysconfdir=$chrootdir/etc<BR>
--localstatedir=$chrootdir/var $args<BR>
<BR>
## add static patch<BR>
#wget<BR>
<A HREF="http://www.bennyvision.com/projects/nagios/nagios-1.0b6-static-cgi-v0.1.patch">http://www.bennyvision.com/projects/nagios/nagios-1.0b6-static-cgi-v0.1.patch</A><BR>
#patch -p0 cgi/Makefile < nagios-1.0b6-static-cgi-v0.1.patch<BR>
more cgi/Makefile | sed \<BR>
        's/CFLAGS=-g/CFLAGS=-g -static/;s/GDLIBS=.*/GDLIBS=-lgd -lz -lpng -lz<BR>
-lgd -ljpeg -lm/' > $tmp \<BR>
        && mv $tmp cgi/Makefile<BR>
<BR>
<BR>
make all && make install && make install-config<BR>
cp daemon-init $prefix/bin/nagios-init<BR>
<BR>
cd $chrootdir/etc<BR>
touch dependencies.cfg escalations.cfg<BR>
for i in cgi.cfg timeperiods.cfg nagios.cfg resource.cfg; do<BR>
        [ ! -f $i ] && cp $i-sample $i<BR>
done<BR>
chmod 711 $chrootdir<BR>
<BR>
ln -s / /var/www/var/www<BR>
<BR>
<<<<BR>
note: if you don't want the last symlink, you must have a separate<BR>
commons/locations.h for the cgi with chrooted path and a chrooted<BR>
nagios.cfg (with chrooted path)<BR>
<BR>
note2: time for resubmit a chroot port for openbsd maybe, Benny :)<BR>
<BR>
note3: to answer questions about why chroot, maybe because nagios is not<BR>
the only thing in apache or the box, and you don't want to lower<BR>
security of the rest only for nagios ...<BR>
<BR>
note4: last thing at work is systrace policies ;)<BR>
<BR>
note5: please cc.<BR>
<BR>
<BR>
<BR>
-------------------------------------------------------<BR>
This SF.net email is sponsored by: If flattening out C++ or Java<BR>
code to make your application fit in a relational database is painful,<BR>
don't do it! Check out ObjectStore. Now part of Progress Software.<BR>
<A HREF="http://www.objectstore.net/sourceforge">http://www.objectstore.net/sourceforge</A><BR>
_______________________________________________<BR>
Nagios-users mailing list<BR>
Nagios-users@lists.sourceforge.net<BR>
<A HREF="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</A><BR>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<BR>
::: Messages without supporting info will risk being sent to /dev/null<BR>
</FONT>
</P>

</BODY>
</HTML>