Nagios in OpenBSD 3.3 with Apache chroot
I was doing this with Nagios 1.1 and nagios-plugins 1.3.1. Here’s my
configure command line for Nagios:
./configure --sbindir=/var/www/nagios/cgi-bin \
--datadir=/var/www/nagios/htdocs \
--sysconfdir=/var/www/nagios/etc \
--localstatedir=/var/www/nagios/var \
--with-gd-lib=/usr/local/lib \
--with-gd-inc=/usr/local/include \
--with-init-dir=/usr/local/nagios/init
This is with the gd, jpeg, png, and freetype packages from ports
installed (along with others I’ve installed long since). Note that
pretty much everything is stuck in /var/www/nagios. I figure that
the CGI scripts will need access to pretty much all of this,
especially the data (--localstatedir) and the configuration files
(--sysconfdir). You can tweak individual directories either from
the main configuration file, or in common/locations.h (or
locations.h.in) in the source. You’ll also want static CGI
scripts; check out
http://www.bennyvision.com/projects/nagios/index.php for a patch that
works after you’ve run configure (or, presumably it works; I did
it by hand in cgi/Makefile.in). Also note that I tossed the init
script in /usr/local/nagios/init/.
For nagios-plugins’ configure I used:
LIBS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" \
./configure --sbindir=/var/www/nagios/cgi-bin \
--datadir=/var/www/nagios/htdocs \
--sysconfdir=/var/www/nagios/etc \
--localstatedir=/var/www/nagios/var \
--with-trusted-path=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
I wanted the LDAP plug-in to work, and apparently though ldconfig
-r shows libldap, you still need to give GCC/ld
-L/usr/local/lib to have it find it. Includes too. Note that
these all get installed in /usr/local/nagios.
I haven’t tested this yet; I’ll try and update here when I do.