nrpe:unable to read output
这是nagios运行脚本时出现的错误,原因是执行脚本需要有root的权限
解决办法(以监控ftp的脚本为例):
# mount /dev/cdrom /media/cdrom # rpm -ivh sudo-1.6.9pl7-3.el5.i386.rpm# visudo
#Defaults requiretty (注释掉) nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/ftp.sh (多个脚本的话设置多行):wq
# su - nagios -c 'sudo /usr/local/nagios/libexec/ftp.sh' (看看执行是否成功)
# vi /usr/local/nagios/etc/nrpe.cfg
command[check_ftp]=/usr/bin/sudo /usr/local/nagios/libexec/ftp.sh
:wq
# killall nrpe
# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
其它略