• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1557
  • Last Modified:

Centos 6.4 Nagios/NRPE Installation

I am having trouble installing NRPE on Nagios(Centos6.4).

FYI—I am installing/configuring a home network to perform the installation at work.
OS = Centos 6.4
Web Interface
I have installed/configured the Nagios Core and then the Nagios plugins. I am now installing/configuring NRPE plugin(latest stable release).  Installing/configuring NRPE has been successful up this part:
Test NRPE Daemon Install

#netstat –at | grep nrpe----expected results
/usr/local/nagios/libexec/check_nrpe  -H localhost
CHECK NRPE: Error – could not complete handshake.
I googled the error and got check the /etc/xinetd/nrpe and verify the only_from ip is the IP from for nagios monitoring server.
Check the /etc/xinetd/nrpe file only_from section and it is set to
Can the loopback be the Nagios Web Interface and/or monitoring server? Is right/wrong? I never created a web interface…help.
  • 3
  • 3
1 Solution
Daniel HelgenbergerCommented:
Normally setting up NRPE listening to loopback only makes no sense. To test it really, please make it listen to an external address and access it from there.

Is nrpe running?
service nrpe start

Open in new window

You can off course setup NRPE to listen on loopback only if you call check_nrpe with
check_nrpe -H

Open in new window

This command should print sth. like:
NRPE v2 running

Open in new window

Actually, this is often used as check command dependency on production setups.

I myself always found it much easier to run NRPE in full daemonized mode, not using xinetd. This way you have full control in nrpe.cfg. I suggest to try this first, chances are  the connection problem is gone.

The most important things in nrpe.cfg:

Open in new window

Make sure you make a connection from one of the IPs listed under allowed_hosts. Also, make sure to set up listening addresses in server_address; or comment this out if you want nrpe to listen on all interfaces (recommended for testing).
And last but not least set debug=1 to have errors in /var/log /messages.
So when you run check_nrpe, make sure you run in another terminal:
tail -f /var/log/messages

Open in new window

Also when nrpe is listening on external external IP make sure to open port tcp/5666 and have the daemon on startup:
iptables -I 1 INPUT -p tcp --dport 5666 -j ACCEPT
chkconfig nrpe on

Open in new window

PS: If you are new to nagios, have a look at nconf, this is a free configuration system for nagios, much like the one you get with commercial nagiosXI. And, for a lot of cool plugins check out Nagios Exchange. For all those fancy RRD graphs I think the easiest tool will be pnp4nagios
Seth SimmonsSr. Systems AdministratorCommented:
don't specify localhost; use the actual physical interface address

are you using ssl?  handshake messages are because of trying to communicate over ssl and failing.  use -n for both the server args line in your xinetd.d/nrpe file and in the check_nrpe command line
gumball60Author Commented:
/usr/local/nagios/libexec/check_nrpe -H localhost (I typed exactly this... anything wrong?)
service nrpe start
nrpe: unrecognized service

If I need to establish/create a new IP address for the Nagios and/or NRPE, how do I do it?
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Daniel HelgenbergerCommented:
Is nrpe really installed? Check this with:
rpm -qa |grep nrpe

Open in new window

If you do not see  something like 'nagios-nrpe' please install it:
yum install nagios-nrpe

Open in new window

If it failed to install in the frirst place, run:
yum reinstall nagios-nrpe

Open in new window

I use nrpe from rpm-forge repos.
gumball60Author Commented:
helge000---NRPE was not installed.....I installed it and verified it's installation...Thanks
seth2740---I beginning to understand that using localhost is wrong, I am new at this...Here are my local configuration
#ifconfig -a
inet addr:
inet addr:

Any Corrections???
Daniel HelgenbergerCommented:
For this test set any static IP on eth0 and bring the interface up. You can also use wlan0 if you like and this is static or an DHCP reservation.

Now edit /etc/nagios/nrpe.cfg and set the config  values accordingly to my first post; but in your static IP for the X.X.X.X
Do not forget to open the firewall port!

Start or restart nrpe service.

Test the connection with check_nrpe:
chech_nrpe -H
check_nrpe -H <your static ip>

Open in new window

For your tests it may still make sense to run commands via loopback; but if you want to try out a possible production installation use a physical interface; better still install nrpe on a remote machine and let nagios do some status checks.

PS: SSL is enabled in the standard config by default and something you really want to keep enabled. Disable this for isolated tests only.
gumball60Author Commented:
I should be followed your original suggestion.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now