NRPE check_init_service returning: Unable to read output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
GreatWolfResorts
Posts: 48
Joined: Tue Mar 15, 2011 11:12 am
Location: Madison, WI
Contact:

NRPE check_init_service returning: Unable to read output

Post by GreatWolfResorts »

We're looking to monitor a few of our Ubuntu servers Nagios. I walked through the initially installation of the client on a clean Ubuntu test server by following this documentation:

http://assets.nagios.com/downloads/nagi ... _Agent.pdf

Brief description of procedures is as follows:

Code: Select all

Apt-get install python-software-properties
Add-apt-repository ppa:nagiosinc/ppa
Apt-get update
Apt-get install nagios-agent
Apt-get install sysstat
The only checks failing at this point are the service checks, referencing check_init_service. These are returning "NRPE: Unable to read output."

Code: Select all

[root@noc libexec]# ./check_nrpe -H 10.*.*.* -t 30 -c check_init_service -a 'cron'
NRPE: Unable to read output
The services in question are:
  • cron
    apache2
    ssh
    rsyslog
I did however notice that running the following check returned success for the nagios-nrpe-server service:

Code: Select all

[root@noc libexec]# ./check_nrpe -H 10.*.*.* -t 30 -c check_init_service -a 'nagios-nrpe-server'
 * nagios-nrpe is running
My instinct is telling me this is permission related, but I'm just not savvy enough in Linux to know where to go from here. Any help would be greatly appreciated!
Nagios XI 5.2.5 | CentOS6.3 x86_64 | Virtual Instance on VMware vSphere 6
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRPE check_init_service returning: Unable to read output

Post by scottwilkerson »

I believe you need to run visudo and provide nagios user access to files and applications.

Code: Select all

nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_init_service
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
GreatWolfResorts
Posts: 48
Joined: Tue Mar 15, 2011 11:12 am
Location: Madison, WI
Contact:

Re: NRPE check_init_service returning: Unable to read output

Post by GreatWolfResorts »

Looks like no dice on that one. I added the line you specified to visudo and went as far as reboot the remote client. What I'm curious about is the path you gave me /usr/local/nagios/libexec/check_init_service doesn't exist on the remote machine. It appears these are found at /usr/lib/nagios/plugins. I've tried this path as well in visudo without luck.
Nagios XI 5.2.5 | CentOS6.3 x86_64 | Virtual Instance on VMware vSphere 6
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRPE check_init_service returning: Unable to read output

Post by scottwilkerson »

you used the full path to this file correct?

Code: Select all

/usr/lib/nagios/plugins/check_init_service
Also, you will likely need to modify the command command[check_init_service] in your nrpe.cfg to start with sudo if it doesn't.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
GreatWolfResorts
Posts: 48
Joined: Tue Mar 15, 2011 11:12 am
Location: Madison, WI
Contact:

Re: NRPE check_init_service returning: Unable to read output

Post by GreatWolfResorts »

Sorry, yes - the full path used is:

Code: Select all

/usr/lib/nagios/plugins/check_init_service
I also added "sudo" in front of the command command[check_init_service] in nrpe.cfg but still receiving failure after service restarts.

When I run the check locally it appears to return value just fine. It's only when attempting to check from our Nagios server that it fails.

Remote Server

Code: Select all

root@TL-UBUNTU:/usr/lib/nagios/plugins# ./check_init_service cron
cron start/running, process 679
Nagios Server

Code: Select all

[root@noc libexec]# ./check_nrpe -H 10.*.*.* -c check_init_service -a cron
NRPE: Unable to read output
Nagios XI 5.2.5 | CentOS6.3 x86_64 | Virtual Instance on VMware vSphere 6
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: NRPE check_init_service returning: Unable to read output

Post by mguthrie »

Can you run:

Code: Select all

tail -f /var/log/messages
on the client machine and attempt the check again. Do you see any errors showing up in the syslog that point to the issue?
User avatar
GreatWolfResorts
Posts: 48
Joined: Tue Mar 15, 2011 11:12 am
Location: Madison, WI
Contact:

Re: NRPE check_init_service returning: Unable to read output

Post by GreatWolfResorts »

I'm tailing /var/log/syslog on the remote machine. Turns out the later versions of Ubuntu don't use a messages log anymore. It doesn't appear I have anything to work with on the syslog side. The most I have generated is a cron job running every 10 minutes, and an earlier record of me starting up the nrpe service:

Code: Select all

Apr 18 08:02:39 TL-UBUNTU nrpe[898]: Starting up daemon
Apr 18 08:02:39 TL-UBUNTU nrpe[898]: Warning: Daemon is configured to accept command arguments from clients!
Apr 18 08:02:39 TL-UBUNTU nrpe[898]: Listening for connections on port 5666
Apr 18 08:02:39 TL-UBUNTU nrpe[898]: Allowing connections from: 10.*.*.*
Nagios XI 5.2.5 | CentOS6.3 x86_64 | Virtual Instance on VMware vSphere 6
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE check_init_service returning: Unable to read output

Post by lmiltchev »

I am not sure what version of Ubuntu you are running, but you can try editing this file (backup the file first, just in case something goes wrong!):

Code: Select all

sudo vi /etc/rsyslog.d/50-default.conf
Make sure that these two sections are uncommented:

Code: Select all

*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages

daemon.*;mail.*;\
news.err;\
*.=debug;*.=info;\
*.=notice;*.=warn |/dev/xconsole
After you edit the file, run:

Code: Select all

sudo restart rsyslog
After this, you *should* be able to tail the /var/log/messages.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
GreatWolfResorts
Posts: 48
Joined: Tue Mar 15, 2011 11:12 am
Location: Madison, WI
Contact:

Re: NRPE check_init_service returning: Unable to read output

Post by GreatWolfResorts »

Looks like making that change in /etc/rsyslog.d/50-default.conf and restarting the rsyslog did the trick. it generated the message log and allowed me to tail it. I ran the check again on the Nagios server and it now response appropriately:

Code: Select all

[root@noc libexec]# ./check_nrpe -H 10.*.*.* -c check_init_service -a cron
cron start/running, process 679
Looks like we can close the door on this one. Thanks everyone for your assistance!
Nagios XI 5.2.5 | CentOS6.3 x86_64 | Virtual Instance on VMware vSphere 6
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE check_init_service returning: Unable to read output

Post by lmiltchev »

I'm glad I could help!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked