你的位置:首页 > 操作系统

[操作系统]CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.


今天,在用icinga服务器端测试客户端脚本时,报如下错误:

[root@mysql-server1 etc]# /usr/local/icinga/libexec/check_nrpe -H 192.168.244.146 -c check_users -a 10 20

CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

查看客户端/var/log/messages日志,有如下信息:

Jan 18 15:50:20 mysql-server2 nrpe[3328]: Error: Request contained command arguments!Jan 18 15:50:20 mysql-server2 nrpe[3328]: Client request was invalid, bailing out...

修改客户端nrpe的配置文件

# vim /usr/local/icinga/etc/nrpe.cfg 

dont_blame_nrpe=1

重启客户端程序

[root@mysql-server2 etc]# /etc/init.d/icinga-nrpe restart

但还是无济于事,后来,才发现NRPE插件编译的时候没有指定--enable-command-args选项,导致命令行参数是不可用的。

只得重新编译客户端NRPE插件

# cd /usr/src/icinga-nrpe-2.14/

# ./configure --enable-command-args

# make all

# make install

# make install-plugin

# make install-init

# make install-xinetd

# make install-daemon-config

修改完相关参数后,重新测试,OK

[root@mysql-server1 etc]# /usr/local/icinga/libexec/check_nrpe -H 192.168.244.146 -c check_users -a 10 20

USERS OK - 1 users currently logged in |users=1;10;20;0