The deployment installation of Nagios 4.1.1 can be referenced http://coosh.blog.51cto.com/6334375/1741257
Objective:
The Nagios client defaults to a plugin that has no self-drawing, and requires additional installation, which describes the most common plug-in PNP. In the old boy's teacher's video, he recommended the 0.4 version, and suggested that you do not have to use the newer version. Although I agree with his point of view, but in the spirit of research and study, I installed the latest 0.6.25, the installation process encountered a lot of problems, and solved, here to do a record.
Pre-Preparation:
Install Nagios and deploy here no longer repeat, find http://docs.pnp4nagios.org/, page is manual, download link above. In addition, PNP must use Rrd-tool, Perl, so the most straightforward is yum install rrdtool* perl*, and need to pay attention to open Apache Mod_rewrite function (default is already open)
Download installation
Tar -xvzf pnp4nagios-head.tar.gzcd pnp4nagios./configure*** configuration summary for pnp4nagios-0.6.2 23-12-2009 *** General Options: --------- ---------------- ------------------- nagios user/group: nagios nagios Install directory: /usr/local/pnp4nagios HTML Dir: /usr/local/pnp4nagios/share Config Dir: /usr/local/pnp4nagios/etc location of rrdtool binary: /usr/bin/ rrdtool version 1.2.12 rrds perl modules: FOUND (version 1.2012) rrd Files stored in: /usr/local/pnp4nagios/var/perfdata process_perfdata.pl Logfile: /usr/local/pnp4nagios/var/perfdata.log Perfdata files (NPCD) stored in: /usr/local/pnp4nagios/var/spool web interface options: -- ----------------------- ------------------- html url: http://localhost/pnp4nagios/ apache config file: /etc/apache2/conf.d/ pnp4nagios.conf review the options above for accuracy. if they look okay, type ' Make all ' to compile.make allmake Fullinstall
The above code is the official installation method, if Nagios is installed with the source code default configuration, and the other is installed through Yum, then the official method can be completed, the installation of the path is/usr/local/pnp4nagios/, The user name and group used by the runtime are Nagios
When I tried to access the PNP page when I found unable to figure out, in the/usr/local/pnp4nagios/var/perfdata directory without production data files, baffled its solution, Baidu, found that the original 0.6 version of the PNP and Nagios 4.1.1 a bit " Incompatible ", cannot use the default sync mode, change to bulk mode (block mode).
#################################################################################
# Open Pnp4nagios log function, in fact, this step is optional, not necessarily open, but if you encounter a problem, open the log function will be convenient to debug, so it is recommended to open. #
#################################################################################
Vi/usr/local/pnp4nagios/etc/process_perfdata.cfg
#把log_level改为2
# Loglevel 0=silent 1=normal 2=debug
#
Log_level = 2
Be cautious and restart the httpd and Nagios services
You can then see the log messages in the Tail/usr/local/pnp4nagios/var/perfdata.log.
The problem I encountered was cant find Nagios environment. Exiting ....
Then Baidu some, found to use bulk mode instead
Refer to the official manual Http://docs.pnp4nagios.org/pnp-0.6/config#bulk_mode
Make the following changes/usr/local/nagios/etc/nagios.cfg file
Process_performance_data=1
Enable_environment_macros=1
Service_perfdata_command=process-service-perfdata
Host_perfdata_command=process-host-perfdata
Service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
Service_perfdata_file_template=datatype::serviceperfdata\ttimet:: $TIMET $\thostname:: $HOSTNAME $\tservicedesc::$ Servicedesc$\tserviceperfdata:: $SERVICEPERFDATA $\tservicecheckcommand:: $SERVICECHECKCOMMAND $\thoststate::$ Hoststate$\thoststatetype:: $HOSTSTATETYPE $\tservicestate:: $SERVICESTATE $\tservicestatetype:: $SERVICESTATETYPE $
Service_perfdata_file_mode=a
Service_perfdata_file_processing_interval=15
Service_perfdata_file_processing_command=process-service-perfdata-file
Host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
Host_perfdata_file_template=datatype::hostperfdata\ttimet:: $TIMET $\thostname:: $HOSTNAME $\thostperfdata::$ Hostperfdata$\thostcheckcommand:: $HOSTCHECKCOMMAND $\thoststate:: $HOSTSTATE $\thoststatetype:: $HOSTSTATETYPE $
Host_perfdata_file_mode=a
Host_perfdata_file_processing_interval=15
Host_perfdata_file_processing_command=process-host-perfdata-file
Make the following changes/usr/local/nagios/etc/objects/commands.cfg file
Define Command{
Command_name Process-host-perfdata
command_line/usr/bin/perl/usr/local/pnp4nagios/libexec/process_perfdata.pl
}
Define Command{
Command_name Process-service-perfdata
Command_line/usr/bin/perl/usr/local/pnp4nagios/libexec/process_perfdata.pl-d HOSTPERFDATA
}
Define Command{
Command_name Process-service-perfdata-file
command_line/usr/local/pnp4nagios/libexec/process_perfdata.pl--bulk=/usr/local/pnp4nagios/var/service-perfdata
}
Define Command{
Command_name Process-host-perfdata-file
command_line/usr/local/pnp4nagios/libexec/process_perfdata.pl--bulk=/usr/local/pnp4nagios/var/host-perfdata
}
Restart the httpd and Nagios services. Because the acquisition needs a certain amount of time, can not immediately see the data in the Web interface, but generally after a few seconds, you can observe the/usr/local/pnp4nagios/var/perfdata directory of the corresponding host name of the directory generation, if there is, generally normal. If it's still not working, check the log file for troubleshooting.
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/7A/CB/wKioL1a4kOLQOwcWAAKTp3DTo8c146.jpg "style=" float: none; "title=" qq20160208205528.jpg "alt=" Wkiol1a4kolqowcwaaktp3dto8c146.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/7A/CB/wKioL1a4kOXQNvXyAAJh4mdrYkM170.jpg "style=" float: none; "title=" qq20160208205557.jpg "alt=" Wkiol1a4koxqnvxyaajh4mdrykm170.jpg "/>
Linux Learning Note: Installing the diagram plugin PnP 0.6.25 for Nagios 4.1.1