check_nrpe Unable to read output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

check_nrpe Unable to read output

Post by akepley »

I just upgraded to 2014R1.2

I created a new monitored host and services and some of the services (specifically yum, memory, and CPU) are coming back "Unknown: NRPE: Unable to read output".

I have tried the following:

checked the client nrpe.cfg file:

Code: Select all

# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
        flags           = REUSE
        socket_type     = stream
        port            = 5666
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
        log_on_failure  += USERID
        disable         = no
        only_from       = 172.16.17.95
}
Checked the scripts:

Code: Select all

-rwx------. 1 root   root     3060 Jun 23 14:24 custom_check_mem
Notice this check requires sudo, so I added to the sudoers file for nagios user:

Code: Select all

Defaults:nagios !requiretty
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/custom_check_mem
Nothing has changed the output of the original error:

Code: Select all

Memory Usage;UNKNOWN;SOFT;3;NRPE: Unable to read output
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_nrpe Unable to read output

Post by tmcdonald »

Can you post the custom_check_mem file? I am guessing that calls check_nrpe, but if that is the case is there any reason you have a wrapper?
Former Nagios employee
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Re: check_nrpe Unable to read output

Post by akepley »

I'm sorry, I'm misunderstanding. Do you want me to post the file contents for the custom_check_mem file from the client server under /usr/local/nagios/libexec?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_nrpe Unable to read output

Post by Box293 »

Yes, please attach the custom_check_mem file from the client server (you might need to give it a .txt extension).
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Re: check_nrpe Unable to read output

Post by akepley »

File Attached
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_nrpe Unable to read output

Post by tmcdonald »

Are any of your NRPE checks working or is it just this one failing?
Former Nagios employee
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Re: check_nrpe Unable to read output

Post by akepley »

Just a few of the services. See the attached screenshot.
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_nrpe Unable to read output

Post by abrist »

I presume the monitored server is cent/rhel? Can you run the check from the cli?

Code: Select all

/usr/local/nagios/libexec/custom_check_mem
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Re: check_nrpe Unable to read output

Post by akepley »

The monitored server is a VM on VMWare running RHEL.

As nagios user running the custom_check_mem I get permission denied on the monitored server. This is after I have added the following to sudoers:

Code: Select all

nagios ALL=NOPASSWD: /usr/local/nagios/libexec/custom_check_mem
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_nrpe Unable to read output

Post by slansing »

Hmm permission denied eh? How were nrpe and the nagios plugins package installed on this system? Did you just use the xi-linux-agent guide? What is the output of the following when ran on that system?:

Code: Select all

ll /usr/local/nagios/libexec/

ll /usr/local/nagios/
Locked