天天看點

[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