One: Prepare before installation
Nagios server:192.168.1.10
Nagios client:192.168.1.11
This post installs Nagios only using the Nagios mail alarm feature, if you need to paint another installation of cacti, or other plugins
Second: Installation Services
To operate on the Nagios server:
Installing apache+php
Yum install httpd httpd-devel php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml gcc glibc glibc-co Mmon GD Gd-devel OpenSSL openssl-devel
Groupadd Nagios
Useradd Nagios
Useradd-g Nagios Nagios
Usermod-g Nagios Apache
wget http://sourceforge.net/projects/nagios/?source=directory
Tar zxvf nagios-3.2.0.tar.gz
CD nagios-3.2.0
./configure--prefix=/usr/local/nagios--with-command-group=nagios
Make all
Make install
Make Install-init
Make Install-config
Make Install-commandmode
Make install-webconf
Htpasswd-c/usr/local/nagios/etc/htpasswd.users Nagiosadmin
Service httpd Restart
nagios-plugins:www.nagios.org
Tar zxvf nagios-plugins-1.4.14.tar.gz
CD nagios-plugins-1.4.14
./configure--prefix=/usr/local/nagios--with-nagios-user=nagios--with-nagios-group=nagios
Make && make install
wget http://sourceforge.net/projects/nagios-cn/files/latest/download
TAR-XJF nagios-cn-3.2.3.tar.bz2
CD nagios-cn-3.2.3
./configure
Make all
Make install
http://sourceforge.net/projects/nagios/files/nrpe-2.x/
Tar zxvf nrpe-2.13.tar.gz
CD nrpe-2.13
./configure
Make all
Make Install-plugin
Vi/usr/local/nagios/etc/objects/commands.cfg added at the end
Define Command {
Command_name Check_nrpe
Command_line $USER 1$/check_nrpe-h $HOSTADDRESS $-C $ARG 1$
}
Check that the configuration file is correct
/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg
Operating on the monitored host:
Useradd-s/sbin/nologin Nagios
Tar zxvf nagios-plugins-1.4.14.tar.gz
CD nagios-plugins-1.4.14
./configure--prefix=/usr/local/nagios--with-nagios-user=nagios--with-nagios-group=nagios
Make && make install
Tar zxvf nrpe-2.13.tar.gz
CD nrpe-2.13
./configure
Make all
Make Install-plugin
Make Install-daemon
Make Install-daemon-config
Make install-xinetd
Yum Install xinetd
Vim/etc/xinetd.d/nrpe
Add Only_from = back to the address of the monitor side :192.168.1.10
Make sure that/etc/services has a Nrpe 5666/tcp #NRPE这一行 and no add
Restart the XINETD service, configured at this point by the monitoring end
/usr/local/nagios/libexec/check_nrpe-h the address of the monitored side
If "NRPE v2.12" can be displayed, it indicates that NRPE can communicate with the monitored side normally.
The installation is complete, and the configuration starts next.
This article from "People want to have a dream, in case the realization of" blog, please be sure to keep this source http://yangke.blog.51cto.com/9530509/1568512
Server Monitoring-nagios Installation Chapter