1. First make sure that the Nagios monitoring software is installed on the server side
650) this.width=650; "title=" 6.jpg "src=" Http://s3.51cto.com/wyfs02/M00/5C/2A/wKiom1UbsOzjKJeBAAR2k-QP5TY349.jpg " alt= "Wkiom1ubsozjkjebaar2k-qp5ty349.jpg"/>
2. Install the Nrpe plugin on the monitor side
[email protected] ~]# yum install xinetd OpenSSL openssl-devel-y
[Email protected] ~]# wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
[Email protected] ~]# tar xvf nrpe-2.15.tar.gz
[Email protected] ~]# cd/root/nrpe-2.15
[Email protected] nrpe-2.15]#/configure--prefix=/usr/local/nagios-plugins-2.0.3/
[[email protected] nrpe-2.15]# make all
[email protected] nrpe-2.15]# make Install-plugin
[Email protected] nrpe-2.15]# Ll/usr/local/nagios-4.0.8/libexec/check_nrpe
-rwxrwxr-x. 1 Nagios nagios 76769 APR 1 17:35/usr/local/nagios-4.0.8/libexec/check_nrpe
[Email protected] nrpe-2.15]#
3. Install the client software (nagios-plugins and Nrpe) on the Linux managed side
[email protected] ~]# yum install OpenSSL openssl-devel xinetd-y
[Email protected] ~]# groupadd-g Nagios
[Email protected] ~]# useradd-r-s/sbin/nologin-u 500-g nagios Nagios
[Email protected] ~]# wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
[Email protected] ~]# wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
[Email protected] ~]# tar xvf nagios-plugins-2.0.3.tar.gz
[Email protected] ~]# tar xvf nrpe-2.15.tar.gz
[Email protected] ~]# CD nagios-plugins-2.0.3
[Email protected] nagios-plugins-2.0.3]#/configure--prefix=/usr/local/nagios-plugins-2.0.3--with-nagios-user= Nagios--with-nagios-group=nagios
[[email protected] nagios-plugins-2.0.3]# make && make install
[Email protected] nagios-plugins-2.0.3]# cd/usr/local/
[Email protected] local]# chown-r Nagios:nagios nagios-plugins-2.0.3/
[Email protected] local]# cd/root/nrpe-2.15
[Email protected] nrpe-2.15]#/configure--prefix=/usr/local/nagios-plugins-2.0.3/
[[email protected] nrpe-2.15]# make all
[email protected] nrpe-2.15]# make Install-plugin
[email protected] nrpe-2.15]# make Install-daemon
[email protected] nrpe-2.15]# make Install-daemon-config
[email protected] nrpe-2.15]# make install-xinetd
[Email protected] nrpe-2.15]# ll/usr/local/nagios-plugins-2.0.3/
Total 20
Drwxrwxr-x. 2 Nagios nagios 4096 APR 1 17:18 Bin
Drwxrwxr-x. 2 Nagios nagios 4096 APR 1 17:18 etc
Drwxr-xr-x. 2 Nagios nagios 4096 APR 1 17:10 include
Drwxrwxr-x. 2 Nagios nagios 4096 APR 1 17:18 libexec
Drwxr-xr-x. 3 Nagios nagios 4096 APR 1 17:10 share
[Email protected] nrpe-2.15]# Vim/etc/xinetd.d/nrpe
Only_from = 127.0.0.1 192.168.1.247--Add monitoring server-side address
[Email protected] nrpe-2.15]# vim/usr/local/nagios-plugins-2.0.3/etc/nrpe.cfg
allowed_hosts=127.0.0.1,192.168.1.247--Add the IP address of the monitoring server host
[Email protected] nrpe-2.15]# vim/etc/services
Nrpe 5666/tcp # Nrpe--Add server listening port
[Email protected] nrpe-2.15]#/etc/init.d/xinetd restart
stopping xinetd: [OK]
Starting xinetd: [OK]
[Email protected] nrpe-2.15]# Netstat-antup | grep 5666
TCP 0 0::: 5666:::* LISTEN 32747/xinetd
[Email protected] nrpe-2.15]#/usr/local/nagios-plugins-2.0.3/libexec/check_nrpe-h localhost
NRPE v2.15
[Email protected] nrpe-2.15]#
3. Test the connection on the monitor side, add the host to be controlled side
[Email protected] nrpe-2.15]#/usr/local/nagios-4.0.8/libexec/check_nrpe-h 192.168.1.248
NRPE v2.15
[Email protected] etc]# cd/usr/local/nagios-4.0.8/etc/objects/
[Email protected] objects]# cp-a templates.cfg tong2.cfg
[Email protected] objects]# vim tong2.cfg
This article is from the "Days Together" blog, please be sure to keep this source http://tongcheng.blog.51cto.com/6214144/1627424
Monitoring software Nagios Add Linux Host