I wrote this a few years ago for building Nagios 1.x on Linux and plugins for Linux and HP-UX. I'd do it differently today and may
rewrite this soon. There used to be more to this, but most of it is irrelevant unless you have a synced directory for plugins and
a few other touches to the Nagios infrastructure that aren't on this page. There is a LOT more to this ;)
Tim Maletic wrote an article for Syadmin about the directory synchronization that backs up this Nagios installation's plugins and NRPE environment.
The article isn't available online, but you can probably get a back issue.
Secure, Automated File Distribution
# Nagios
./configure --prefix=/opt/nagios \
--enable-embedded-perl \
--with-perlcache \
--with-template-objects \
--with-cgiurl=/nagios/cgi-bin \
--with-htmlurl=/nagios \
--with-nagios-user=nagios \
--with-nagios-grp=nobody \
--with-command-user=nagios \
--with-command-grp=nobody \
--with-lockfile=/var/opt/nagios/.lockfile \
--datadir=/var/opt/nagios/share \
--sysconfdir=/etc/opt/nagios \
--sharedstatedir=/var/opt/nagios/com \
--localstatedir=/var/opt/nagios
# Nagios Plugins on Linux
./configure --prefix=/opt/nagios \
--with-cgiurl=/cgi-bin/nagios \
--with-nagios-user=nagios \
--with-nagios-group=nobody \
--datadir=/var/opt/nagios/share \
--sysconfdir=/etc/opt/nagios \
--sharedstatedir=/var/opt/nagios/com \
--localstatedir=/var/opt/nagios \
--with-mysql=/opt/mysql
# Nagios Plugins in /usr/local/nagios/Linux (this directory is rsynced every 5 minutes)
./configure --prefix=/usr/local/nagios/Linux \
--libexecdir=/usr/local/nagios/Linux \
--with-nagios-user=nagios \
--with-nagios-group=nobody \
--with-trusted-path=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin \
--sysconfdir=/usr/local/nagios
# Nagios Plugins in /usr/local/nagios/HP-UX (uses gcc from porting archive)
# the df is GNU coreutils compiled on HP-UX and installed as /usr/local/gnu/HP-UX/bin/gnu-df
PATH=/usr/local/bin:$PATH \
./configure --prefix=/usr/local/nagios/HP-UX \
--libexecdir=/usr/local/nagios/HP-UX \
--with-df-command="/usr/local/gnu/HP-UX/bin/gnu-df -lk" \
--with-openssl=/usr/local/ssl \
--with-nagios-user=nagios \
--with-nagios-group=nobody \
--with-trusted-path=/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin \
--sysconfdir=/usr/local/nagios