NRPE: Unable to read output

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

NRPE: Unable to read output

Post 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
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: NRPE: Unable to read output

Post 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
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: NRPE: Unable to read output

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE: Unable to read output

Post by Box293 »

Can you please post your nrpe.cfg file on the remote server.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: NRPE: Unable to read output

Post 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
Attachments
nrpe.cfg
(10 KiB) Downloaded 122 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE: Unable to read output

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: NRPE: Unable to read output

Post 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
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: NRPE: Unable to read output

Post 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)
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE: Unable to read output

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked