重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
创建 nagios用户
成都创新互联公司主营南阳网站建设的网络公司,主营网站建设方案,成都App定制开发,南阳h5小程序定制开发搭建,南阳网站营销推广欢迎南阳等地区企业咨询
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