Nagios nrpe and sudo: “NRPE: Unable to read output”
On CentOS, you can encounter the following behaviour when configuring an nrpe plugin with sudo:
1 2 |
/usr/lib/nagios/plugins/check_nrpe -H 1.2.3.4 -c check_exim Mailqueue WARNING - query returned no output! |
Given that check_exim is defined as follows, in nrpe.conf:
1 |
command[check_exim]=/usr/lib64/nagios/plugins/check_eximmailqueue -w 50 -c 100 |
1 |
nagios ALL=(ALL) NOPASSWD:/usr/lib64/nagios/plugins/check_eximmailqueue |
1 |
#Defaults requiretty |
1 2 |
/usr/lib/nagios/plugins/check_nrpe -H 1.2.3.4 -c check_exim Mailqueue OK - 11 messages on queue |