nagios的安装和配置(三)

孤街醉人 提交于 2020-01-14 12:08:14

二、检测远程主机的私有服务

1)服务器端安装nrpe插件

1、下载nrpe插件

wget http://nchc.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz

2、解压编译安装

tar xf nrpe-2.15.tar.gz -C /usr/src/

cd /usr/src/nrpe-2.15/

./configure
make all
make install-plugin
make install-daemon
make install-daemon-config

3、在command.cfg中添加命令

define command{
        command_name    check_nrpe
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }

2)被监控端安装nagios插件、nrpe插件

 

3)nrpe 服务安装

[root@Nrpe src]# wget http://nchc.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
[root@Nrpe src]# tar zxf nrpe-2.15.tar.gz
[root@Nrpe src]# cd nrpe-2.15
[root@Nrpe nrpe-2.15]# ./configure --prefix=/usr/local/nrpe
[root@Nrpe nrpe-2.15]# make all
[root@Nrpe nrpe-2.15]# make install-plugin
[root@Nrpe nrpe-2.15]# make install-daemon
[root@Nrpe nrpe-2.15]# make install-daemon-config

[root@Nrpe ~]# ln -s /usr/local/nrpe/etc /etc/nrpe
[root@Nrpe ~]# cp -rf /etc/nrpe/nrpe.cfg /etc/nrpe/nrpe.cfg.old

 

 

[root@Nrpe ~]# grep -v -E '^#|^$' /etc/nrpe/nrpe.cfg
log_facility=daemon
pid_file=/var/run/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1,192.168.88.138
 
dont_blame_nrpe=0
allow_bash_command_substitution=0
debug=0
command_timeout=60
connection_timeout=300
command[check_users]=/usr/local/nrpe/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nrpe/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_sda]=/usr/local/nrpe/libexec/check_disk -w 20% -c 10% -p /dev/sda
command[check_zombie_procs]=/usr/local/nrpe/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nrpe/libexec/check_procs -w 150 -c 200


##########
# 测试启动
# /usr/local/nrpe/bin/nrpe -c /usr/local/nrpe/etc/nrpe.cfg -d

# 自带的启动脚本
[root@Nrpe nrpe-2.15]# cp -rf init-script.in /etc/init.d/nrpe
[root@Nrpe nrpe-2.15]# chmod a+x /etc/init.d/nrpe
[root@Nrpe ~]# chkconfig nrpe on
[root@Nrpe ~]# /etc/init.d/nrpe start

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!