check_nrpe to Nagios xi

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

check_nrpe to Nagios xi

Post by gshergill »

Hi Nagios Community,

I was wondering if there's any specific changes requires for Nagios xi in order for a Nagios Core machine to check_nrpe to it.

I noticed that there was no need to install nrpe on there as it already had nrpe.cfg and .../xinetd.d/nrpe installed.

I am able to nrpe from Nagios xi to my remote hosts fine, the changes required after installing nrpe/plugins being;

1. edit /etc/xinetd.d/nrpe - allow ip of nagiosxi machine
2. edit /.../etc/nrpe.cfg - add check commands

So I followed these steps on Nagios xi but my Nagios Core machine keeps saying;

Code: Select all

Connection refused by host
This is on the command line (and therefore the web interface too).

I've tried with the IP Tables disabled as well but that didn't help.

To check I haven't done something wrong on the core side, I tested with a currently working server with NRPE installed and it worked fine.

Thank you for any help/tips.

Kind Regards,

Gary Shergill

EDIT: Just remembered, Nagios xi is CentOS, all other hosts I monitor with NRPE are Ubuntu. Maybe I'm missing a configuration step to do with CentOS?

EDIT: Tried installing another version of NRPE, 2.13 (default is 2.12 on Nagios xi).
Commands used were;

Code: Select all

rm -rf /usr/local/nagios/etc/nrpe.cfg /etc/xinetd.d/nrpe
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz/download?use_mirror=freefr&utm_expid=6384-3
tar -zxvf nrpe-2.13.tar.gz
cd nrpe-2.13
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
touch /etc/xinetd.d/nrpe
make install-xinetd
vi /etc/xinetd.d/nrpe
vi /usr/local/nagios/etc/nrpe.cfg
service xinetd restart
service nagios restart
Unfortunately this didn't solve the issue either.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nrpe to Nagios xi

Post by lmiltchev »

I would recommend using our linux agent installer. Please, review the following document:

http://assets.nagios.com/downloads/nagi ... _Agent.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_nrpe to Nagios xi

Post by gshergill »

Hi lmiltchev,

Sorry I think there is a slight misunderstanding.

At the moment I am using certain services on Nagios xi, such as check_jabber_login.pl to see if Openfire is running correctly on our linux servers.

I was previously checking the distributed monitoring functionality which allows Nagios xi to retrieve data from Nagios Core servers (lightening the load on Nagios xi).

I am currently trying to, I guess, do it the other way around. We only want some Nagios Core servers to display data from our main xi server, for example if Openfire is running.

My plan was to use the check_nrpe plugin on the Nagios Core server to grab certain plugin information from Nagios xi. To do this I added to the nrpe.cfg file on Nagios xi the following;

Code: Select all

command[check_openfire_server1]=/usr/local/nagios/libexec/check_jabber_login.pl -H server1 -p 5222 -u nagios -P password
command[check_openfire_server2]=/usr/local/nagios/libexec/check_jabber_login.pl -H server2 -p 5222 -u nagios -P password
I then edited /etc/xinitd.d/nrpe and allowed a Nagios Core IP.

On the Nagios Core I added the following;

Code: Select all

define service{
        use                          generic-service  
        host_name               server1
        service_description   Openfire Login
        check_command       check_nrpe!check_openfire_server1
        }
Or from the command line;

Code: Select all

../../libexec/check_nrpe -H server1 -c check_openfire_server1
Both come with error;

Code: Select all

Connection refused by host
So does the standard;

Code: Select all

../../libexec/check_nrpe -H server1
Am I missing something on the Nagios xi server? Or should I not be able to do this?

Note that I directly added to server1 access by the nagios core via NRPE and it working. Just seem to be issue using NRPE to get the info from Nagios xi.

I hope that made sense, Thank you.

Kind Regards,

Gary Shergill

p.s. Thank you for the link, that's actually a great help for monitoring our CentOS linux machines.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nrpe to Nagios xi

Post by lmiltchev »

This makes sense, but let's try the following:

1. Log into a terminal to your Nagios xi server and run:

Code: Select all

ifconfig
2. Log into a terminal to your Nagios Core box, and run:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <your_Nagios_xi_IP_address>
If you get a "connection refused" error, check the following:
- make sure you restarted the xinetd on the Nagios xi server:

Code: Select all

service xinetd restart
- then run:

Code: Select all

netstat -at | grep nrpe
- make sure firewall is not blocking port 5666

Code: Select all

iptables -L -n
- see if you can telnet from your Nagios Core machine into your Nagios xi machine:

Code: Select all

telnet <your_Nagios_xi_IP_address> 5666

Hope this help.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_nrpe to Nagios xi

Post by gshergill »

Hi lmiltchev,

Thanks for the reply.
2. Log into a terminal to your Nagios Core box, and run:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <your_Nagios_xi_IP_address>
This worked perfectly, seems the issue is with the hostname for the Nagios xi machine.
Been having some trouble with the hostname not being resolved correctly on Nagios xi, ssh from the terminal and access via the web interface both require IP addresses instead of hostnames.

Changed the -H argument in the command to use the ip address instead of the hostname now and everything is working fine.

Thank you again.

Kind Regards,

Gary Shergill