NagiosGraphicalPnpInstallation and configurationZTThe specific process is as follows:
(1) After nagios is installed, continue to install pnp. Pay attention to the installation of rrdtool. Tar-xvzf pnp-0.4.13.tar.gz
Cd pnp-0.4.13
./Configure
Make all
Make install
Make install-config
Make install-init
---------------------------------------------------------------------------------
FAQ:
*** Configuration summary for pnp 0.4.13 02-19-2009 ***
General Options:
--------------------------------------------
Nagios user/group: nagios
Install directory:/usr/local/nagios
HTML Dir:/usr/local/nagios/share/pnp
Config Dir:/usr/local/nagios/etc/pnp
Path to rrdtool:/usr/local/bin/rrdtool (Version 1.2.23)
RRDs Perl Modules: *** not found ***
RRD Files stored in:/usr/local/nagios/share/perfdata
Process_perfdata.pl Logfile:/usr/local/nagios/var/perfdata. log
Perfdata files (NPCD) stored in:/usr/local/nagios/var/spool/perfdata/
-----------------------------------------
Process_perfdata.pl installed in/usr/local/nagios/share/
Install the configuration sample file in/usr/local/nagios/libexecs
Config. php installed on/usr/local/nagios/etc/pnp
(2) modify the configuration file
①
Cd/usr/local/nagios/etc/pnp/
Cpprocess_perfdata.cfg-sample process_perfdata.cfg
Cp npcd. cfg-sample npcd. cfg
Cp rra. cfg-sample rra. cfg
Chown-R nagios: nagios *
②
Vi/usr/local/nagios/etc/pnp/process_perfdata.cfg
....
LOG_FILE =/usr/local/nagios/var/perfdata. log
#
# Loglevel 0 = silent 1 = normal 2 = debug
#
LOG_LEVEL = 2
# Change to 2 in debug mode.
③
Modify etc/objects/templates. cfg to add a new command (add a small Sun Flag)
# Add "host-pnp" after use to add a small Sun icon next to the host name on the Monitoring Chart. Click this icon to view the pnp image.
Define host {
Name host-pnp
Register 0
Action_url/nagios/pnp/index. php? Host = $ HOSTNAME $
Process_perf_data 1
}
# You can also add srv-pnp in the service column. After adding the srv-pnp, a small sun is added to the corresponding column.
Define service {
Name srv-pnp
Register 0
Action_url/nagios/pnp/index. php? Host = $ HOSTNAME $ & srv = $ SERVICEDESC $
Process_perf_data 1
}
④
Modify etc/nagios. cfg
Find the following items and remove the comments.
Process_performance_data = 1
Host_perfdata_command = process-host-perfdata
Service_perfdata_command = process-service-perfdata
⑤
Modify commands. cfg
# 'Process-host-perfdata' command definition
Define command {
Command_name process-host-perfdata
Command_line/usr/local/nagios/libexec/process_perfdata.pl
}
# 'Process-service-perfdata' command definition
Define command {
Command_name process-service-perfdata
Command_line/usr/local/nagios/libexec/process_perfdata.pl
}
⑥ The following configurations are required for nginx security issues:
Modify nginx. conf in the web server configuration file of pnp. Pay attention to security issues. I have not performed security verification here.
Location/pnp /{
Root/usr/local/nagios/share /;
Location ~ . * \. Php? $
{
# Fastcgi_pass unix:/tmp/php-cgi.sock;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fcinclude gi. conf;
}
}
If open_basedir is enabled, You need to modify php. ini.
Open_basedir =
"/Opt/htdoc:/opt/php/lib/php:/tmp/session:/tmp/upload:/usr/local/nagios/share/pnp: /usr/local/nagios/etc/pnp:/usr/local/nagios/share/perfdata:/usr/local/rrdtool/bin/rrdtool