nagios + chroot: Return code of 127 for check of service

Marc Powell mpowell at ena.com
Sat May 17 15:48:06 CEST 2003


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.


--
Marc

Sent from a very tiny wireless device with a very tiny unlit keyboard.


-----Original Message-----
From: julien Touche <julien.touche at lycos.com>
To: nagios-users at lists.sourceforge.net <nagios-users at lists.sourceforge.net>
Sent: Sat May 17 02:50:53 2003
Subject: [Nagios-users] nagios + chroot: Return code of 127 for check of service


Hi

i finally manage to get nagios working in apache chroot but i get tons 
of warning:  Return code of 127 for check of service 'XXX' ...
and all the rest works quite right.
i ask myself if it is the cgis which make this check or the daemon ?


Regards

		Julien

here my little script to install in chroot

<<<
prefix=/opt/nagios
chrootprefix=/var/www
chrootdir=$chrootprefix/htdocs/admin/nagios
tmp=`mktemp /tmp/tmp.XXXXXX` || exit 1

args="--with-gd-lib=/usr/local/lib --with-gd-inc=/usr/local/include"

./configure --prefix=$prefix --sbindir=$chrootdir/sbin 
--datadir=$chrootdir/share --with-htmurl=/admin/nagios 
--with-cgiurl=/admin/nagios/cgi-bin --sysconfdir=$chrootdir/etc 
--localstatedir=$chrootdir/var $args

## add static patch
#wget 
http://www.bennyvision.com/projects/nagios/nagios-1.0b6-static-cgi-v0.1.patch
#patch -p0 cgi/Makefile < nagios-1.0b6-static-cgi-v0.1.patch
more cgi/Makefile | sed \
	's/CFLAGS=-g/CFLAGS=-g -static/;s/GDLIBS=.*/GDLIBS=-lgd -lz -lpng -lz 
-lgd -ljpeg -lm/' > $tmp \
	&& mv $tmp cgi/Makefile


make all && make install && make install-config
cp daemon-init $prefix/bin/nagios-init

cd $chrootdir/etc
touch dependencies.cfg escalations.cfg
for i in cgi.cfg timeperiods.cfg nagios.cfg resource.cfg; do
	[ ! -f $i ] && cp $i-sample $i
done
chmod 711 $chrootdir

ln -s / /var/www/var/www

<<<
note: if you don't want the last symlink, you must have a separate 
commons/locations.h for the cgi with chrooted path and a chrooted 
nagios.cfg (with chrooted path)

note2: time for resubmit a chroot port for openbsd maybe, Benny :)

note3: to answer questions about why chroot, maybe because nagios is not 
the only thing in apache or the box, and you don't want to lower 
security of the rest only for nagios ...

note4: last thing at work is systrace policies ;)

note5: please cc.



-------------------------------------------------------
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful, 
don't do it! Check out ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
_______________________________________________
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20030517/47a5fc44/attachment.html>


More information about the Users mailing list