Page 1 of 2

check_nrpe error

Posted: Thu May 07, 2015 8:03 am
by cloudcom
Hi,
I installed nrpe agent from source on a linux server according to the this document
http://assets.nagios.com/downloads/nagi ... ios-XI.pdf

I can see nrpe version when i run below code from nagiosxi

Code: Select all

#check_nrpe -H <remote-server-ip> 


I added this remote server to nagiosxi from linux-server wizard.
But it gives errors like this: CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

And i checked the remote server logs:
May 7 15:36:19 nagios-worker1 xinetd[29355]: START: nrpe pid=29357 from=::ffff:172.16.100.133
May 7 15:36:19 nagios-worker1 xinetd[29355]: EXIT: nrpe status=0 pid=29357 duration=0(sec)
May 7 15:36:21 nagios-worker1 xinetd[29355]: START: nrpe pid=29358 from=::ffff:172.16.100.133
May 7 15:36:21 nagios-worker1 xinetd[29355]: EXIT: nrpe status=0 pid=29358 duration=0(sec)
May 7 15:36:26 nagios-worker1 xinetd[29355]: START: nrpe pid=29359 from=::ffff:172.16.100.133
May 7 15:36:26 nagios-worker1 nrpe[29359]: Error: Request contained command arguments!
May 7 15:36:26 nagios-worker1 nrpe[29359]: Client request was invalid, bailing out...
May 7 15:36:26 nagios-worker1 xinetd[29355]: EXIT: nrpe status=0 pid=29359 duration=0(sec)


I set dont_blame_nrpe=1 in nrpe.cfg file but it doesnt work?


Centos 6.5 64bit
Nagios Core 4.0.5
Nagios XI 2014R1.0

Re: check_nrpe error

Posted: Thu May 07, 2015 9:13 am
by ssax
Did you restart xinetd after setting dont_blame_nrpe=1?

Code: Select all

service xinetd restart
Please post your /usr/local/nagios/etc/nrpe.cfg.

Re: check_nrpe error

Posted: Fri May 08, 2015 2:59 am
by cloudcom
Yes, I restarted xinetd.
I follow this document http://assets.nagios.com/downloads/nagi ... utions.pdf

nrpe.cfg file is here:
nrpe.cfg.txt

Re: check_nrpe error

Posted: Fri May 08, 2015 9:29 am
by jdalrymple
In that document it doesn't specify that in order to be able to include command arguments it has to be explicitly defined during the configure process. I will see to it that the document gets updated.

In the meantime - redo the compile process but add "--enable-command-args" to your configure command.

Re: check_nrpe error

Posted: Mon May 11, 2015 4:01 am
by cloudcom
I re-compiled the package with --enable-command-args option and set dont_blame_nrpe=1 in nrpe.cfg file. It worked.
But another problem occured. Althoug I add this nrpe installed server via linux-server wizard with some service check (swap usage, memory usage, load, disk usage) it gives an error like: NRPE: Command 'check_mem' not defined. Just load service gives result, others return "command not defined".

As far as I know nrpe reads the nrpe.cfg file for check commands and it has some check commands as default:

# The following examples use hardcoded command arguments...
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200


Since "check_load" command is set as default, it gives the result and others don't.
So, Do I have to edit manually these lines in order to monitor other services(swap usage, memory usage, load, disk usage)? :(
if so, why do I sign "check boxes" during linux-server wizard? Is it just for creating the commands under service management ?
I expected that these configuraitons were set automatically like nsclient.

Re: check_nrpe error

Posted: Mon May 11, 2015 10:23 am
by ssax
Yes, you need to define the commands in your nrpe.cfg file and make sure the plugins are installed as well for each one that you want to use.

Re: check_nrpe error

Posted: Tue May 12, 2015 3:10 am
by cloudcom
This manual intervention is not nice for NagiosXI.
And I installed nagios plugins from source code but check_mem plugin which is used as default by linux-server wizard did not come. I had to find it from web. I was disappointed for this workload when I use NagiosXI.

One more question.
Although I determine arguments for the check command in nrpe.cfg file, why NagiosXI define another arguments for that command like check_nrpe!check_mem! -w 20 -c 10?
However I already determine tresholds in nrpe.cfg file.

Re: check_nrpe error

Posted: Tue May 12, 2015 9:42 am
by lmiltchev
You are experiencing these issues as you decided to install NRPE and Nagios plugins manually by following this document:

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf

When you install from source, recompile, etc. there is always more work involved. We always recommend using our official linux agent installer.

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

The "fullinstall" script installs NRPE and Nagios plugins, and sets up bunch of commands in the "common.cfg" file, that are "compatible" with Linux Server wizard. In any case, this is the easiest route to go. Since, you've already installed NRPE and Nagios plugins manually, you will just have to tweak your commands in the nrpe.cfg.

Re: check_nrpe error

Posted: Wed May 13, 2015 7:06 am
by cloudcom
Hımm. I installed from source because the server had not internet conneciton.

Is there any way to remove nrpe which is installed from source ?
or
Can I use ./fullinstall script over the old installation? (I am thinking of installing the agent as offline by using fullinstall script)

Re: check_nrpe error

Posted: Wed May 13, 2015 10:47 am
by jdalrymple
Hi cloudcom...

As you've identified NagiosXI is intended more for point and click type administrators than those that like to do deep dive activities such as compiling from source. For this reason we do encourage using the methods outlined in the NagiosXI wizards to install your agents.

In order to clean out your install from source just remove the binary, the config file and whatever startup method you're using (xinetd.d config or init file). Going forward anytime you can use the installers provided by the XI wizard we encourage you to do so to guarantee ease of implementation with XI.

As far as arguments in nrpe or arguments in your nagios services config - you choose. We offer either way for a couple of reasons.

Doing it in the nrpe.cfg simplifies your services definitions for multiple hosts as you can just update the thresholds and other args at each individual host and have a generic service check at the Nagios end.

Doing it in nagios config files reduces the need to reach out to multiple servers to modify configurations - it's more central.

Everyone has their preference and we give you the flexibility to choose your own.