NRPE: Unable to read output

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: NRPE: Unable to read output

Postby natalia.fitsyk » Wed Nov 16, 2016 7:46 am

Hi,
[root@client_nrpe ~]# su nrpe
bash-4.1$ /usr/bin/sudo /usr/local/nagios/libexec/check_swap -w 20% -c 10%
SWAP OK - 100% free (4076 MB out of 4094 MB) |swap=4076MB;818;409;0;4094
bash-4.1$ /usr/local/nagios/libexec/check_swap -w 20% -c 10%
SWAP OK - 100% free (4076 MB out of 4094 MB) |swap=4076MB;818;409;0;4094

I delete sudo fo rcheck_swap and now working, but don't working check_jmeter, I delete sudo for check_jmeter too.

I think nrep user is right because I see into /var/log/messages this output :

Nov 16 13:34:52 client_nrpe nrpe[1154]: Running command: /usr/local/nagios/libexec/check_swap -w 20% -c 10%
Nov 16 13:34:52 client_nrpe nrpe[1154]: Command completed with return code 0 and output: SWAP OK - 100% free (4076 MB out of 4094 MB) |swap=4076MB;818;409;0;4094
Nov 16 13:34:52 client_nrpe nrpe[1154]: Return Code: 0, Output: SWAP OK - 100% free (4076 MB out of 4094 MB) |swap=4076MB;818;409;0;4094
Nov 16 13:34:52 client_nrpe nrpe[1154]: Connection from pn▒▒▒#177 closed.
Nov 16 13:35:01 client_nrpe nrpe[1181]: Connection from 10.10.10.10 port 19111
Nov 16 13:35:01 client_nrpe nrpe[1181]: Host address is in allowed_hosts
Nov 16 13:35:01 client_nrpe nrpe[1181]: Handling the connection...
Nov 16 13:35:01 client_nrpe nrpe[1181]: Host is asking for command 'check_jmeter' to be run...
Nov 16 13:35:01 client_nrpe nrpe[1181]: Running command: /usr/local/nagios/libexec/check_site.sh
Nov 16 13:35:01 client_nrpe nrpe[1181]: Command completed with return code 1 and output:
Nov 16 13:35:01 client_nrpe nrpe[1181]: Return Code: 1, Output: NRPE: Unable to read output
Nov 16 13:35:01 client_nrpe nrpe[1181]: Connection from pn▒▒▒#177 closed.

Thanks.
Natalia
natalia.fitsyk
 
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: NRPE: Unable to read output

Postby tgriep » Wed Nov 16, 2016 10:12 am

Try doing the same test for the check_site.sh script.
Login to that remote host, run the following and post the errors.
Code: Select all
su nrpe
/usr/bin/sudo /usr/local/nagios/libexec/check_site.sh -w 15 -c 20
/usr/local/nagios/libexec/check_site.sh -w 15 -c 20
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 4930
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE: Unable to read output

Postby natalia.fitsyk » Thu Nov 17, 2016 3:20 am

Hi,
[root@client_nrpe ~]# su nrpe
bash-4.1$ /usr/bin/sudo /usr/local/nagios/libexec/check_site.sh -w 15 -c 20
OK : sum:2052 : 2.052 seconds to complete.
bash-4.1$ /usr/local/nagios/libexec/check_site.sh -w 15 -c 20
OK : sum:2144 : 2.144 seconds to complete.
bash-4.1$ sudo /usr/local/nagios/libexec/check_nrpe -H 10.10.10.10 -c check_jmeter
NRPE: Unable to read output
bash-4.1$ /usr/local/nagios/libexec/check_nrpe -H 10.10.10.10 -c check_jmeter
NRPE: Unable to read output

Thanks.
Natalia
natalia.fitsyk
 
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: NRPE: Unable to read output

Postby tgriep » Thu Nov 17, 2016 11:47 am

Try and remove the sudo from the command in the /usr/local/nagios/libexec/check_site.sh script on the remote host and see if that works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 4930
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE: Unable to read output

Postby natalia.fitsyk » Fri Nov 18, 2016 3:07 am

Hi,
I try it but nothing, the output is same:

[root@client_nrpe ~]# su nrpe
bash-4.1$ /usr/local/nagios/libexec/check_nrpe -H localhost -c check_jmeter
NRPE: Unable to read output

[root@client_nrpe ~]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_jmeter
NRPE: Unable to read output

Thanks.
Natalia
natalia.fitsyk
 
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: NRPE: Unable to read output

Postby natalia.fitsyk » Fri Nov 18, 2016 6:35 am

Hi,
I solved my problem:
I put "Defaults:nrpe !requiretty " on the sudoers file config

[root@client_nrpe ~]# grep nrpe /etc/sudoers
Defaults:nrpe !requiretty

[root@client_nrpe ~]# /usr/local/nagios/libexec/check_nrpe -H 10.10.10.10 -c check_jmeter
OK : sum:2423 : 2.423 seconds to complete.

Thanks everyone.
Regards.
Natalia.
natalia.fitsyk
 
Posts: 29
Joined: Mon Aug 22, 2016 8:14 am

Re: NRPE: Unable to read output

Postby dwhitfield » Fri Nov 18, 2016 11:03 am

Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 2723
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Previous

Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 2 guests