Building notes for using Nagios with HP-UX Web Server Suite gcc --- Download & install gcc and its dependencies from HP-UX Porting Center. zlib ---- # ./configure --prefix=/opt/nagios # make # make install libpng ------ # export LDOPTS="-L /opt/nagios/lib" # ./configure --prefix=/opt/nagios # make # make install # unset LDOPTS freetype -------- # export GNUMAKE=/usr/local/bin/gmake # ./configure --prefix=/opt/nagios # gmake # gmake install # unset GMAKE nagios ------ Create nagios user and nagcmd group Make a nagios group in advance. I think the configure script makes one with default values and gid=201 and it will screw things up later # /usr/sbin/groupadd -g 310 nagios # /usr/sbin/useradd -g 310 -u 310 -c "Nagios" -d /home/nagios nagios # passwd -x nagios # /usr/sbin/groupadd -g 311 nagcmd # /usr/sbin/usermod -G nagcmd nagios # /usr/sbin/usermod -G nagcmd www # might need to shut down HPWS, manually edit /etc/group Compile nagios # export LDOPTS="-L /opt/nagios/lib" remove /opt/imake/bin from the path so that its install script doesn't get picked up by autoconf # PATH="$(cat /etc/PATH):/usr/local/bin" ./configure --prefix=/opt/nagios --with-command-group=nagcmd --with-gd-lib=/opt/nagios/lib --with-gd-inc=/opt/nagios/include # cd common # gcc -c snprintf.c # cd .. # make all # make install # make install-init # make install-config # make install-commandmode # vi /opt/nagios/etc/objects/contacts.cfg Put your e-mail here # make install-webconf Append the contents of /etc/httpd/conf.d/nagios.conf to your HPWS httpd.conf. # htpasswd -c /opt/nagios/etc/htpasswd.users nagiosadmin # /sbin/init.d/hpws_apache stop # /sbin/init.d/hpws_apache start Fix permissions # chown -R nagios:nagios /opt/nagios/bin # chown -R nagios:nagios /opt/nagios/etc # chown -R nagios:nagios /opt/nagios/libexec # chown -R nagios:nagios /opt/nagios/sbin # chown -R nagios:nagios /opt/nagios/share # chown -R nagios:nagios /opt/nagios/var # chown nagios:nagcmd /opt/nagios/var/rw # chown nagios:nagcmd /opt/nagios/var/rw/nagios.cmd nagios-plugins -------------- Download nagios-plugins.tar.gz Patch temporarily /usr/include/machine/sys/getppdp.h (I know it sucks) Before: extern union mpinfou spu_info[]; After: extern union mpinfou *spu_info; # gunzip nagios-plugins-1.4.12.tar.gz # tar xvf nagios-plugins-1.4.12.tar # cd nagios-plugins-1.4.12 # PATH="$(cat /etc/PATH):/usr/local/bin" ./configure --prefix=/opt/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-ping-command=/usr/sbin/ping # make # make install Unpatch getppdp.h NOW! start nagios ------------ # /opt/nagios/bin -v /opt/nagios/etc/nagios.cfg # /sbin/init.d/nagios start Compile NRPE ------------ First, make a libwrap.a by going in /opt/ssh/src/tcp_wrappers_7.6-ipv6.4 and building what's in it. # cd /opt/ssh/src/tcp_wrappers_7.6-ipv6.4 # make REAL_DAEMON_DIR=/tmp hpux You'll endup with a static libwrap.a you have to keep for later. # tar xvf nrpe-2.12.tar # cd nrpe-2.12 Open src/nrpe.c and add the following two defines at the top: #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ #define LOG_FTP (11<<3) /* ftp daemon */ Also add this since libwrap doesn't have rfc931_timeout: int rfc931_timeout=15; # PATH="$(cat /etc/PATH):/usr/local/bin" ./configure --prefix=/opt/nagios --with-ssl-inc=/opt/openssl/include --with-ssl-lib=/opt/openssl/lib/hpux32 Open src/Makefile and change LIBWRAPLIBS to point to librap.a: LIBWRAPLIBS= ./libwrap.a You cipied libwrap in src/, right? # make # make install Install NRPE ------------ Look in my configure.sh and unconfigure.sh scripts in /opt/nrpe/bin