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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gumball60Author Commented:
I should be followed your original suggestion.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.