天天看點

NRPE: Unable to read output的原因及排除

nrpe被監控端運作定義指令正常,監控端運作

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

錯誤提示: NRPE: Unable to read output

監控端運作:#/usr/local/nagios/libexec/check_nrpe -H 117.121.9.200

可以傳回nrpe版本資訊,說明nrpe通信正常。

被監控端 check_dellraid 的定義: /usr/local/nagios/etc/nrpe.cfg

       command[check_dellraid]=/usr/bin/sudo /usr/local/nagios/libexec/check_dellraid

腳本路徑沒有錯,同時擁有執行權限;

經過認真排查,該指令需要調用隻有root可操作的raid指令,故

      應該編輯  /etc/sudoers檔案

      #vim  /etc/sudoers

            nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/check_dellraid

同時得注釋掉一下行,表示不需要控制終端