Nagios 客户端安装nrpe的时候,报错NRPE: Unable to read output

[root@localhost etc]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_disk
NRPE: Unable to read output

参照这个文档进行操作,还是不行
[nagios监控] NRPE: Unable to read output 的原因及排除
nrpe被监控端运行定义命令正常,监控端运行

   #/usr/local/nagios/libexec/check_nrpe -H 117.121.9.200 -c check_oracle_tablespace

错误提示: NRPE: Unable to read output

监控端运行:#/usr/local/nagios/libexec/check_nrpe -H 117.121.9.200

可以返回nrpe版本信息,说明nrpe通信正常。

被监控端 check_oracle_tablespace 的定义: /usr/local/nagios/etc/nrpe.cfg

    command[check_oracle_tablespace]=/usr/bin/sudo /usr/local/nagios/libexec/check_tablespace.sh

脚本路径没有错,同时拥有执行权限。经过认真排查,应该编辑 /etc/sudoers文件

   #vim  /etc/sudoers

         nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/check_tablespace.sh

同时得注释掉一下行,表示不需要控制终端

        #Defaults    requiretty

否则,仍然会出现:NRPE: Unable to read output 错误