Install PNP for Showing Performance Data of Nagios
Environment
Procedures
Prepare needed applications
In case, performance data is here, but get this error - "Directory /usr/local/nagios/share/perfdata/hostname not found."
Go to edit /usr/local/nagios/etc/pnp/process_perfdata.cfg
References
- Ubuntu 8.04
- Nagios 3.X
- PNP 4.X
Procedures
Prepare needed applications
#apt-get install rrdtool librrds-perlDownload the latest PNP - http://sourceforge.net/project/showfiles.php?group_id=191615
#apt-get install php5 libapache2-mod-php5 php5-gd
#tar zxvf pnp-[version].tar.gzEdit /usr/local/nagios/etc/nagios.cfg
#cd pnp-[version]
#./configure
#make all
#make install
#make install-config
#make install-init
process_performance_data=1Edit /usr/local/nagios/etc/objects/commands.cfg. Choose the bulk mode with npcd for performance data processing
enable_environment_macros=1
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata
host_perfdata_file=/usr/local/nagios/var/host-perfdata
service_perfdata_file=/usr/local/nagios/var/service-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$
\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::
$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$
\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::
$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::
$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$
\tSERVICESTATETYPE::$SERVICESTATETYPE$
host_perfdata_file_mode=a
service_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
service_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file
service_perfdata_file_processing_command=process-service-perfdata-file
define command{Then, edit /usr/local/nagios/etc/objects/templates.cfg
command_name process-service-perfdata-file
command_line /bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/perfdata/service-perfdata.$TIMET$
}
define command{
command_name process-host-perfdata-file
command_line /bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/perfdata/host-perfdata.$TIMET$
}
define host{In normal, view the page in new page. If don't like, edit /usr/local/nagios/etc/cgi.cfg
...
action_url /nagios/pnp/index.php?host=$HOSTNAME$
...
}
define service{
...
action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
...
}
#Normal
#action_url_target=_blank
#Use the same frame
action_url_target=_self
In case, performance data is here, but get this error - "Directory /usr/local/nagios/share/perfdata/hostname not found."
Go to edit /usr/local/nagios/etc/pnp/process_perfdata.cfg
- Set LOG_LEVEL to be debug - 2
- It is running default setting if this file isn't here. You can simply rename / copy process_perfdata.cfg-sample
- After that, the log is in /usr/local/nagios/var/perfdata.log
- npcd service is running
- /usr/local/nagios/etc/pnp/npcd.cfg is here
References