NRPE on NagiosXI Server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Andreas_c_Schmidt
Posts: 23
Joined: Mon Sep 24, 2012 10:03 am

NRPE on NagiosXI Server

Post by Andreas_c_Schmidt »

I have 2 Nagios XI Server and like to check the OS vice versa with the nrpe agent.

the idea was that I use the linux agent to gather details from the hosts nagios01 and nagios02. however the checks are all failing with the warning marks.

for example.


[root@nagios-01 etc]# /usr/local/nagios/libexec/check_nrpe -H nagios01 -t 30 -c check_total_procs
PROCS CRITICAL: 283 processes

[root@nagios-01 etc]# /usr/local/nagios/libexec/check_nrpe -H nagios01 -t 30 -c check_total_procs -a '-w 700 -c 1000'
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

[root@nagios-01 etc]# /usr/local/nagios/libexec/check_nrpe -H nagios02 -t 30 -c check_total_procs -a '-w 700 -c 1000'
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

[root@nagios-01 etc]# /usr/local/nagios/libexec/check_nrpe -H nagios02 -t 30 -c check_total_procs
PROCS CRITICAL: 274 processes

Its the same situation for pretty all checks. Is the nrpe installed with the server a much different one that if I would install it on a "normal" linux server?
I have several Redhat server running with the linux-nrpe-agent without any issue.

Thanks for some advise.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: NRPE on NagiosXI Server

Post by abrist »

Andreas_c_Schmidt wrote: [root@nagios-01 etc]# /usr/local/nagios/libexec/check_nrpe -H nagios01 -t 30 -c check_total_procs
PROCS CRITICAL: 283 processes

[root@nagios-01 etc]# /usr/local/nagios/libexec/check_nrpe -H nagios01 -t 30 -c check_total_procs -a '-w 700 -c 1000'
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
It looks like your nrpe.cfg has the arguments statically declared. You will need to either change the static command argument declarations in the nrpe.cfg, or change the check.

You will find lines similar to the following in your nrpe.cfg on either system:

Code: Select all

command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
If you notice the arguments "-w 150 -c 200", they are declared in the command, so you cannot pass these arguments from xi to nrpe without altering the command as follows:

Code: Select all

command[check_total_procs]=/usr/local/nagios/libexec/check_procs $ARG1$
The change to $ARG1$ allows for XI to pass arguments (-a '-w 700 -c 1000') to the check (as long as you compiled nrpe with --command-args and have "dont_blame_nrpe=1" declared in the nrpe.cfg file.
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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE on NagiosXI Server

Post by lmiltchev »

Change the line in the nrpe.cfg on the client, that says:

Code: Select all

dont_blame_nrpe=0
to:

Code: Select all

dont_blame_nrpe=1
and restart the daemon on the client:

Code: Select all

service xinetd restart
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Andreas_c_Schmidt
Posts: 23
Joined: Mon Sep 24, 2012 10:03 am

Re: NRPE on NagiosXI Server

Post by Andreas_c_Schmidt »

Thanks to you 2 to hinting me the solution.

@lmiltchev: "dont_blame_nrpe=0" I didn't blame nrpe, I only pointed out that its "his" fault :D .... No that didnt work alone by itself.

@abrist: You brought me close to this.

Point is the nrpe on the NagiosXI Server is significant different that when installing it to a fresh box.

I did the following:

after comparing the nrpe.conf with the one from one client I copied the one from the client over. there were 2 changes:
- dont_blame_nrpe=1 was dont_blame_nrpe=0 (as per lmiltchev's hint)
- # INCLUDE CONFIG DIRECTORY
#include_dir=<someotherdirectory>
include_dir=/usr/local/nagios/etc/nrpe
on the client here were 2 files with all the commands which are commented in the nrpe.conf. so I copied them into the nrpe directory.

But how bizarre: on the xi server several libexec checks were missing. for example ./check_init_service. So I copied the whole bunch from the client over to the server as well and its now working fine.

I would appreciate if the Nagios XI server would have a full nrpe client integrated since I guess full monitoring of the XI server is not a too far away idea.

regards
Andreas
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NRPE on NagiosXI Server

Post by slansing »

Nagios XI does come standard with these things, and is fully integrated with NRPE, since NRPE was created by Nagios Enterprises. You may have been missing a custom plugin at some point.. but check_init_service does come standard with ALL Nagios XI Installations, at least recent ones.. what version are you running?

You may have also been using an outdated NRPE client on the remote system which compiled with checks deemed unsupported our outdated.
Andreas_c_Schmidt
Posts: 23
Joined: Mon Sep 24, 2012 10:03 am

Re: NRPE on NagiosXI Server

Post by Andreas_c_Schmidt »

We started with XI Server 2012R1.2 and upgraded this week to 1.6 using the tarball and ./fullinstall or ./upgrade.

the linux nrpe agent we used is http://library.nagios.com/library/produ ... inux-agent

I just reinstalled a lab server with 1.6 fresh from the tarball ./fullinstall and in libexec is NO check_init_service (Centos 6.3 x64). Is it meant that after installing the XI server I install the linux-nrpe-agent tarball separate on the nagios XI server ?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NRPE on NagiosXI Server

Post by slansing »

It is possible that this check was part of the agent version installed on earlier versions of XI 2011 since I was going off of one of my older upgraded box's, and not 2012, I will do some more digging and try to find out why it is not installed with the current version of NRPE packaged with XI.

You should not have to recompile NRPE after the install, it is meant that you can just grab additional plugins that you need and place them in the libexec directory, or upload them there via the Web UI.
Locked