一、安装nrpe,编译的时候提示以下信息
checking for SSL headers... configure: error: Cannot find ssl headers
- 原因是缺少openssl-devel包,解决办法
- CentOS
- yum -y install openssl-devel
- debian
- apt-get install libssl-dev
二、服务器端和客户端的nrpe版本必须一致才能正确采集数据,报错如下
- CHECK_NRPE: Socket timeout after 10 seconds
- Connection refused or timed out
三、nrpe参数传递错误
- CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
- 重新编译nrpe
- CentOS
./configure --prefix=/usr/local/icinga --enable-ssl --with-nrpe-user=nagios --with-nrpe-group=nagios --with-nagios-user=nagios --with-nagios-group=nagios --enable-command-args
Debian
./configure --prefix=/usr/local/icinga --enable-ssl --with-nrpe-user=nagios --with-nrpe-group=nagios --with-nagios-user=nagios --with-nagios-group=nagios --enable-command-args --with-ssl-lib=/usr/lib/x86_64-linux-gnu
测试
/usr/local/icinga/libexec/check_nrpe -H x.x.x.x -c check_disk_args -a 4% 11% data
四、check_icmp check_dhcp
权限问题
- 由于对 icinga/libexec 执行了
chown nagios.nagios . -R
出现如下错误
Warning: This plugin must be either run as root or setuid root.
- 解决办法
chown root.nagios check_icmp
chown root.nagios check_dhcp
chmod 4750 check_icmp
chmod 4750 check_dhcp