See PHP4Nagios installation documentation.
In a nutshell:
./configure --with-nagios-user=shinken --with-nagios-group=shinken
make all
make fullinstall
Don’t forget to make PNP4Nagios’ npcd daemon to start at boot, and launch it:
chkconfig --add npcd # On RedHat-like
update-rc.d npcd defaults # On Debian-like
/etc/init.d/npcd start
The module npcdmod is in charge to export performance data from Shinken to PNP.
define module{
module_name NPCDMOD
module_type npcdmod
config_file <PATH_TO_NPCD.CFG>
}
Don’t forget to replace “<PATH_TO_NPCD.CFG>” with your own value; By default something like ‘’/usr/local/pnp4nagios/etc/npcd.cfg’‘.
Edit ‘’/etc/shinken/brokers/broker-master.cfg’’ and find the object Broker to add above defined “NPCDMOD” to its modules line:
define broker{
broker_name broker-1
[...]
modules Simple-log,NPCDMOD
}
Edit ‘’/etc/shinken/modules/webui.cfg’’ and find the object WebUI to add above defined “PNP_UI” to its modules line:
define broker{
module_name WebUI
[...]
modules Apache_passwd,ActiveDir_UI,Cfg_password,PNP_UI
}
Then restart broker :
# /etc/init.d/shinken-broker restart
In order to get the graphs displayed in Thruk, you need to set the action_url option in host and service definitions, and it must include the string “/pnp4nagios/” (Thruk doc).
If you want the link and the graph for all hosts and services, you could set the option directly in the default templates, in ‘’templates.cfg’‘:
define host{
name generic-host
[...]
process_perf_data 1
[...]
#action_url http://<PNP4NAGIOS_HOST>/pnp4nagios/graph?host=$HOSTNAME$
# If not an absolute URI, it must be relative to /cgi-bin/thruk/, not /thruk/!
action_url ../../pnp4nagios/graph?host=$HOSTNAME$
[...]
define service{
name generic-service
[...]
process_perf_data 1
[...]
#action_url http://<PNP4NAGIOS_HOST>/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
# If not an absolute URI, it must be relative to /cgi-bin/thruk/, not /thruk/!
action_url ../../pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
Don’t forget to replace “<PNP4NAGIOS_HOST>” with the server IP/name running PNP4Nagios (Don’t replace $HOSTNAME$ and $SERVICEDESC$!)
Make sure to also have process_perf_data set to 1 for both hosts and services.
Ask PNP4Nagios to link to ‘’/thruk/cgi-bin’’ rather than ‘’/nagios/cgi-bin’‘:
sed -i -e 's,/nagios/cgi-bin,/thruk/cgi-bin,' /opt/pnp4nagios/etc/config_local.php