Go to official Download the latest version nagios-4.0.8 Http://www.nagios.org/download/core
[Email protected] nagios]# tar zxvf nagios-4.0.8.tar.gz
[[email protected] nagios-4.0.8]# make all
[[email protected] nagios-4.0.8]# make install
[email protected] nagios-4.0.8]# make Install-init
[email protected] nagios-4.0.8]# make Install-commandmode
[email protected] nagios-4.0.8]# make Install-config
[email protected] nagios-4.0.8]# make install-webconf
[email protected] nagios-4.0.8]# make Install-exfoliation
[email protected] nagios-4.0.8]# make Install-classicui
2: Install plug-in nagios-plugins-2.0.3.tar.gz http://www.nagios.org/download/plugins
./configure&&make&&make Install
Ln-s/usr/local/nagios/etc/nagios
Personalized plugins are copied to/etc/nagios/libexec.
3: The following RPM package is required to install the Iostat_plugins
[Email protected] iostat_plugins]# ls-h
perl-class-accessor-0.31-1.el5.rf.noarch.rpm perl-params-validate-0.89-1.el5.rf.i386.rpm
perl-config-tiny-2.12-1.el5.rf.noarch.rpm perl-regexp-common-2.120-1.2.el5.rf.noarch.rpm
perl-math-calc-units-1.06-1.el5.rf.noarch.rpm
The following plug-ins can be found online mainly check_traffic.sh
CP check_memory.pl Check_iostat check_file_des check_inode check_netstat check_traffic.sh/usr/local/nagios/libexec
chmod 755/usr/local/nagios/libexec/check_memory.pl
chmod 755/usr/local/nagios/libexec/check_iostat
dos2unix/usr/local/nagios/libexec/check_memory.pl
Dos2unix/usr/local/nagios/libexec/check_iostat
The SNMP package needs to be installed before using check_traffic.sh snmpwalk
RPM-IVH net-snmp-utils-5.3.2.2-9.el5_5.1.i386.rpm
Mkdir-p/var/tmp/nagios && chown-r Nagios.nagios/var/tmp/nagios
Example: How to obtain port information for a switch
/usr/local/nagios/libexec/check_traffic.sh-v 2c-c 3550b-h 172.16.40.9-l
4: Optimization section
[Email protected] etc]# cd/etc/nagios/etc
[Email protected] etc]# htpasswd-c/usr/local/nagios/etc/htpasswd.users admin
New Password:
Re-type New Password:
Adding Password for user admin
Edit Cgi.cfg file, replace nagiosadmin for admin
/etc/init.d/nagios start
/ETC/INIT.D/HTTPD start
5: Drawing PnP
Http://docs.pnp4nagios.org/pnp-0.6/dwnld
Download: pnp4nagios-0.6.24.tar.gz Document Section Http://docs.pnp4nagios.org/pnp-0.6/start
PnP is a Nagios plug-in that can analyze data and store them automatically rrd-databases
RRDtool is an open source industry standard that provides high-performance data recording time series data and graphic rendering systems
Download Link: Http://oss.oetiker.ch/rrdtool/pub/?M=D
Use rrdtool-1.2.12.tar.gz here
[Email protected] rrdtool-1.2.12]#./configure
[[email protected] rrdtool-1.2.12]# make all &&make install
[[email protected] pnp4nagios-0.6.24]# ls/usr/local/rrdtool-1.2.12/installed directory
[Email protected] ~]# CD pnp4nagios-0.6.24
[Email protected] pnp4nagios-0.6.24]#/configure--with-nagios-user=nagios--with-nagios-group=nagios-- With-rrdtool=/usr/local/rrdtool-1.2.12/bin/rrdtool
[[email protected] pnp4nagios-0.6.24]# make all
[[email protected] pnp4nagios-0.6.24]# make install
[email protected] pnp4nagios-0.6.24]# make install-webconf
[email protected] pnp4nagios-0.6.24]# make Install-config
Pnp4nagios sample config files installed * * *
Please run "make Install-init" if you want
BULK Mode with NPCD
The default is to run synchronous mode and compare wasted resources it is the execution of every event that will trigger Process-service-perfdata
So using the bulk mode batch mode here is more complex than synchronous mode but can significantly reduce the load on the Nagios server because the Data collector process_perfdata.pl not invoke each service/host check.
In batch mode, Nagios writes data to a temporary file. This file is handled by Process_perfdata. At a specific interval. Nagios will regularly take care of starting and running it
Process_performance_data=1
#
# Service performance data
#
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 performance data starting with Nagios 3.0
#
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
6: Commissioning
http://192.168.10.100/pnp4nagios/Tip 404 Error
Chown Nagios.nagios/usr/local/nagios/etc/htpasswd.users
| Pnp4nagios Version |
pnp4nagios-0.6.24 |
| Prefix |
/usr/local/pnp4nagios |
| Configure Arguments |
./configure '--with-nagios-user=nagios '--with-nagios-group=nagios '--with-rrdtool=/usr/local/rrdtool-1.2.12/ Bin/rrdtool ' |
| RRD Storage |
/usr/local/pnp4nagios/var/perfdata is readable. |
| RRDtool Binary |
/usr/local/rrdtool-1.2.12/bin/rrdtool is executable by PHP |
| PHP GD Extension |
PHP GD Extension Not available |
| PHP function Proc_open () |
Pass |
| PHP zlib Extension |
Pass |
| PHP Session Extension |
Pass |
| PHP JSON Extension |
Pass |
| PHP MAGIC_QUOTES_GPC |
Off |
| PHP Socket Extension |
Pass |
| Apache Rewrite Module |
Pass |
On the installation CD-ROM query installation can be, what is missing what
[[email protected] centos]# ls *php* | grep GD
php53-gd-5.3.3-1.el5.i386.rpm
php-gd-5.1.6-27.el5_5.3.i386.rpm
Then restart the Web Refresh pass.
Your environment passed all requirements. Remove or rename the /usr/local/pnp4nagios/share/install.php file now.
Cd/usr/local/pnp4nagios/share/
[Email protected] share]# MV install.php Install.php.bak
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/graph?host= $HOSTNAME $&srv= $SERVICEDESC $ ' class= ' tips ' rel= '/pnp4nagios/popup?host=$ hostname$&srv= $SERVICEDESC $
Register 0
}
Installing Nagios PNP under Centos5.6