Page 1 of 1

NRPE: Unable to read output

Posted: Tue Apr 14, 2015 2:21 pm
by stecino
I have two nrpe clients

[root@blah2 etc]# /usr/bin/sudo /usr/local/nagios/libexec/check_file_age -c 30 -f /u01/app/oracle/product/10gr202/j2ee/nns_jq/log/nns_jq_default_island_1/oc4j.out
FILE_AGE OK: /u01/app/oracle/product/10gr202/j2ee/nns_jq/log/nns_jq_default_island_1/oc4j.out is 1 seconds old and 94518751 bytes

[root@blah1 etc]# /usr/bin/sudo /usr/local/nagios/libexec/check_file_age -c 30 -f /u01/app/oracle/product/10gr202/j2ee/nns_jq/log/nns_jq_default_island_1/oc4j.out
FILE_AGE OK: /u01/app/oracle/product/10gr202/j2ee/nns_jq/log/nns_jq_default_island_1/oc4j.out is 1 seconds old and 96979751 bytes

command[check_nnsjp_oc4j_file]=/usr/bin/sudo /usr/local/nagios/libexec/check_file_age -c 30 -f /u01/app/oracle/product/10gr202/j2ee/nns_jq/log/nns_jq_default_island_1/oc4j.out

root@server:/usr/lib/nagios/plugins# ./check_nrpe -H xx.xx.xx.2 -c check_nnsjp_oc4j_file
NRPE: Unable to read output
root@server:/usr/lib/nagios/plugins# ./check_nrpe -H xx.xx.xx.1 -c check_nnsjp_oc4j_file
FILE_AGE OK: /u01/app/oracle/product/10gr202/j2ee/nns_jq/log/nns_jq_default_island_1/oc4j.out is 0 seconds old and 97044990 bytes

on both servers

-rwsr-sr-x 1 root root 3050 Dec 15 2013 check_file_age
in sudoers file -- nagios ALL=(ALL) NOPASSWD: /usr/local/nagios/libexec/check_file_age *


what else can be wrong with the server throwing NRPE: Unable to read output

Re: NRPE: Unable to read output

Posted: Tue Apr 14, 2015 2:44 pm
by jdalrymple
selinux is well known for causing that problem...

Is NRPE working at all? What if you just do

Code: Select all

root@server:/usr/lib/nagios/plugins# ./check_nrpe -H xx.xx.xx.2

Re: NRPE: Unable to read output

Posted: Tue Apr 14, 2015 7:21 pm
by stecino
jdalrymple wrote:selinux is well known for causing that problem...

Is NRPE working at all? What if you just do

Code: Select all

root@server:/usr/lib/nagios/plugins# ./check_nrpe -H xx.xx.xx.2
It is working, I get NRPE 2.15 version back
SELinux is disabled

Re: NRPE: Unable to read output

Posted: Tue Apr 14, 2015 7:34 pm
by Box293
Can you please post your nrpe.cfg file on the remote server.

Re: NRPE: Unable to read output

Posted: Wed Apr 15, 2015 6:51 pm
by stecino
Box293 wrote:Can you please post your nrpe.cfg file on the remote server.
Attached the NRPE client config. Please note: this it is compiled not accept command arguments, therefore arguments are hard coded
I will be changing this in the future, but for now I am trying to fix this particular problem

Re: NRPE: Unable to read output

Posted: Wed Apr 15, 2015 7:04 pm
by Box293
Does the nagios user have permission to access the plugins and file?

Code: Select all

ls -la /usr/local/nagios/libexec/check_file_age
/u01/app/oracle/product/10gr202/j2ee/nns_jq/log/nns_jq_default_island_1/oc4j.out
You might need to enable debugging on the remote server.

Type vi /etc/rsyslogd.conf and press Enter
Type /var/log/messages and press Enter
This takes you to the line in the config file we are after, it will look like:

Code: Select all

*.info;mail.none;authpriv.none;cron.none               /var/log/messages
We need to add ";daemon.debug" to the line:

Code: Select all

*.info;mail.none;authpriv.none;cron.none;daemon.debug               /var/log/messages
Save and exit
Type service rsyslog restart and press Enter

Type sed -i 's/^debug=.*/debug=1/g' /usr/local/nagios/etc/nrpe.cfg and press Enter
Type service xinetd restart and press Enter

Now you can watch the NRPE debug informations sent to /var/log/messages

Re: NRPE: Unable to read output

Posted: Wed Apr 15, 2015 7:53 pm
by stecino
it can run this

sudo -su nagios /usr/local/nagios/libexec/check_file_age -c 30 -f /u01/app/oracle/product/10gr202/j2ee/nns_jq/log/nns_jq_default_island_1/oc4j.out
FILE_AGE CRITICAL: /u01/app/oracle/product/10gr202/j2ee/nns_jq/log/nns_jq_default_island_1/oc4j.out is 997 seconds old and 135995951 bytes

Re: NRPE: Unable to read output

Posted: Wed Apr 15, 2015 9:20 pm
by stecino
I also had debug turned on in the config for nrpe. That's all I got upon executing the command

Apr 15 17:11:34 ...a2 nrpe[11676]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Apr 15 17:11:34 ...a2 xinetd[4177]: EXIT: nrpe status=0 pid=11676 duration=0(sec)

Re: NRPE: Unable to read output

Posted: Wed Apr 15, 2015 11:33 pm
by Box293
stecino wrote:Apr 15 17:11:34 ...a2 nrpe[11676]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Apr 15 17:11:34 ...a2 xinetd[4177]: EXIT: nrpe status=0 pid=11676 duration=0(sec)
Did you do the syslog steps as well? Without these you won't get much info.