This hopes to help with installing PNP4Nagios from source (from my own repository).
By default, this install everything under the /usr/local/pnp4nagios directory.
The first line assumes you want a pnp4nagios directory IN your own home directory. You should modify as necessary.
It also assume Nagios/Icinga Daemon is running under a nagios user and a nagios group. YMMV. Modify accordingly.
- Install Dependencies (TODO)
cd ; git clone https://github.com/russellvt/pnp4nagios.gitcd pnp4nagios
Note: ./man/npcd.8 is generated by ./configure and removed with make clean
make clean./configure --with-nagios-user=nagios --with-nagios-group=nagiosmake all
While make install works, it may fail in certain situations (Read: Some things may not install right).
sudo make install
A more-complete install:
sudo make install-webconfsudo make install-configsudo make install-init
The NPCD (Nagios Perfdata C daemon) service needs to be configured to run on startup.
systemctl daemon-reloadsystemctl enable npcd.servicesystemctl start npcd.service
- NPCD may not start "the first time" after Source installation (system package not tested)
- For
make installthe following errors are observed (Debian 8): - Makefiles should regenerate npcd.8 if it has not been created/compiled
% cd ./man && make install
make[1]: Entering directory '/dir/to/project/pnp4nagios/man'
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/pnp4nagios/man/man8
/usr/bin/install -c -m 755 -o nagios -g nagios npcd.8 /usr/local/pnp4nagios/man/man8
/usr/bin/install: cannot stat ‘npcd.8’: No such file or directory
Makefile:21: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/dir/to/project/pnp4nagios/man'
Makefile:144: recipe for target 'install' failed
make: *** [install] Error 2
- For
make install-webconfthe following errors are observed (Debian 8):
% sudo make install-webconf
cd ./sample-config && make install-webconf
make[1]: Entering directory '/path/to/project/pnp4nagios/sample-config'
/usr/bin/install -c -m 755 -d /etc/httpd/conf.d
/usr/bin/install -c -m 644 httpd.conf /etc/httpd/conf.d/pnp4nagios.conf
/usr/bin/install: cannot stat ‘httpd.conf’: No such file or directory
Makefile:82: recipe for target 'install-webconf' failed
make[1]: *** [install-webconf] Error 1
make[1]: Leaving directory '/path/to/project/pnp4nagios/sample-config'
Makefile:123: recipe for target 'install-webconf' failed
make: *** [install-webconf] Error 2
- Seriously??? (TLDR: It's /etc/apache2 on Debian family boxes)
% sudo make install-config
cd ./sample-config && make install-config
make[1]: Entering directory '/path/to/project/pnp4nagios/sample-config'
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/pnp4nagios/etc
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/pnp4nagios/etc/check_commands
/usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/pnp4nagios/etc/pages
/usr/bin/install -c -m 644 -o nagios -g nagios pnp/config.php /usr/local/pnp4nagios/etc/config.php.0.6.26; \
/usr/bin/install -c -m 644 -o nagios -g nagios pnp/config.php /usr/local/pnp4nagios/etc; \
/usr/bin/install: cannot stat ‘pnp/config.php’: No such file or directory
/usr/bin/install: cannot stat ‘pnp/config.php’: No such file or directory
Makefile:49: recipe for target 'install-config' failed
make[1]: *** [install-config] Error 1
make[1]: Leaving directory '/path/to/project/pnp4nagios/sample-config'
Makefile:111: recipe for target 'install-config' failed
make: *** [install-config] Error 2
- This isn't SysV / systemd aware...
% sudo make install-init
cd ./scripts && make install-init
make[1]: Entering directory '/path/to/project/pnp4nagios/scripts'
/usr/bin/install -c -m 755 -o root -g root -d /etc/init.d
/usr/bin/install -c -m 755 -o root -g root rc.npcd /etc/init.d/npcd
/usr/bin/install -c -m 755 -o root -g root rc.pnp_gearman_worker /etc/init.d/pnp_gearman_worker
make[1]: Leaving directory '/path/to/project/pnp4nagios/scripts'
- Intentional difference between
make cleanandmake distclean(Document)
A list of some of the references I may have used in the creation of this guide, in no particular order.
Some may be used more than others, or some not-at-all. I will fix these later.