创建 nagios用户
useradd nagios
tar xzvfnagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure
make
make install
tar xzvf nrpe-2.1.2.tar.gz
cd nrpe-2.1.2
./configure --prefix=/usr/local/nagios
make all
make install-plugin
make install-daemon
make install-daemon-config
检查插件安装
ll /usr/local/nagios/libexec/
#vi/usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1,192.169.0.201
启动nrpe
#/usr/local/nagios/bin/nrpe -c/usr/local/nagios/etc/nrpe.cfg –d
# netstat -plnt |grep nrpe
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 16831/nrpe
echo‘/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d‘>>/etc/rc.local
[root@nagios-server src]#/usr/local/nagios/libexec/check_nrpe -H 192.168.1.100
NRPE v2.12
若出现版本号,代表nrpe客户端安装成功。
#vi /usr/local/nagios/etc/nrpe.cfg
command[check_users]=/usr/local/nagios/libexec/check_users-w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load-w 15,10,5 -c 30,25,20
#vi /usr/local/nagios/etc/objects/hosts.cfg
define host{
use linux-server,host-pnp
host_name hostb
alias hostb
address 192.168.1.100
}
#vi /usr/local/nagios/etc/objects/services.cfg
define service{
use generic-service,srv-pnp
host_name hostb
service_description check_users
check_command check_nrpe!check_users
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service,srv-pnp
host_name hostb
service_description check_load
check_command check_nrpe!check_load
max_check_attempts 5
normal_check_interval 1
}
#/etc/init.d/nagios checkconfig
#/etc/init.d/nagios restart
本文出自 “此心安处是吾乡” 博客,转载请与作者联系!
Nagios nrpe客户端的安装与配置,布布扣,bubuko.com
原文地址:http://yangrong.blog.51cto.com/6945369/1408526