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

julien Touche julien.touche at lycos.com
Sat May 17 09:50:53 CEST 2003


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





More information about the Users mailing list