今天,在用icinga伺服器端測試客戶端腳本時,報如下錯誤:[root@mysql-server1 etc]# /usr/local/icinga/libexec/check_nrpe -H 192.168.244.146 -c check_users -a 10 20CHECK_NRPE: Rec...
今天,在用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