pnp4nagios plugin installation from source
This document will show on how to install pnp4nagios plug-in to help in systems administrator and network administrators gather nagios data and display it via web graph.
The OS that is used by this installation is centos.
Installation
yum install rrdtool
yum install dejavu-lgc-fonts
wget http://downloads.sourceforge.net/pnp4nagios/pnp-<version>.tar.gz
tar xzvf pnp-<version>.tar.gz
cd pnp*
./configure
make all
make fullinstall
make install-init
make install-config
make install-commandmode
make install-webconf
Configure pnp4nagios
cd /usr/local/pnp4nagios/etc
cp -p misccommands.cfg-sample misccommands.cfg
cp -p nagios.cfg-sample nagios.cfg
cp -p npcd.cfg-sample npcd.cfg
cp -p rra.cfg-sample rra.cfg
cd pages
cp -p web_traffic.cfg-sample web_traffic.cfg
cd /usr/local/pnp4nagios/libexec
Sync graph configuration
cd /usr/local/nagios/etc
vi /usr/local/nagios/etc/nagios.cfg
Edit nagios.cfg to address the following:
process_performance_data=1
enable_environment_macros=1
service_perfdata_command=process-service-perfdata
host_perfdata_command=process-host-perfdata
Update command [commands.cfg]
vi /usr/local/nagios/etc/objects/commands.cfg
Comment all lines after commands.cfg
################################################################################
#
# SAMPLE PERFORMANCE DATA COMMANDS
#
# These are sample performance data commands that can be used to send performance
# data output to two text files (one for hosts, another for services). If you
# plan on simply writing performance data out to a file, consider using the
# host_perfdata_file and service_perfdata_file options in the main config file.
#
################################################################################
Code
+-----------------------------------------------------------------------------------------------+
define command {
command_name process-service-perfdata
command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl
}
define command {
command_name process-host-perfdata
command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
}
+-----------------------------------------------------------------------------------------------+
Validate
nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios restart
Add pnp4nagios pop-up to nagios main page Append to cgi.cfg
# Open in new window
action_url_target=main
Popup pnp4nagios
cd /downloads/pnp4nagios*/contrib/ssi
- Copy contrib/ssi/status-header.ssi from source directory to nagios's share directory
cp status-header.ssi /usr/local/nagios/share/ssi/
cp status-header.ssi.in /usr/local/nagios/share/ssi/
chown nagios:nagios /usr/local/nagios/share/ssi/status-header.ssi
chmod 644 /usr/local/nagios/share/ssi/status-header.ssi
chmod 644 /usr/local/nagios/share/ssi/status-header.ssi.in
Create and update pnp4nagios configuration file
vi /usr/local/nagios/etc/objects/pnp4nagios.cfg
define host {
name host-pnp
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
register 0
}
define service {
name srv-pnp
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
register 0
}
cd /usr/local/pnp4nagios/bin
wget http://verify.pnp4nagios.org/verify_pnp_config
chmod 755 verify_pnp_config
chown nagios:nagios verify_pnp_config
Validate pnp4nagios installation
./verify_pnp_config -m sync --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc
Browse and follow instruction
http://<nagios-server>/pnp4nagios/
mv /usr/local/pnp4nagios/share/install.php /usr/local/pnp4nagios/share/`date +%F`_install.php
Previous page: Nagios Installation from Source Next page: What is the vision of OpenBSD project?

