Page 1 of 2

Getting Check NRPE Error

Posted: Wed Feb 20, 2019 9:43 pm
by ep7network
I installed Nagios core 4.4.3 on Centos 7. I used yum --enablerepo=epel to install Nagios and Nagios plugins. On target host Ubuntu, I installed nrpe and nagios-plugins. On Ubuntu host nrpe.cfg file, I added Nagios server IP address and added a 1 for dont_blame_nrpe.

When I log into Nagios server and look at web interface for Ubuntu host I'm getting CHECK_NRPE:Error - could not connect to x.x.x.x: Connection reset by peer
I've followed many online guides and none seem to work.

On my Nagios server /online support for Nagios suggest verify if nrpe agent is running by checking /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1, I don't have that directory structure. My Nagios files are located in /etc/nagios.

On Nagios server I run service nrpe status and I get nrpe service active running. Not sure what else to do?

Re: Getting Check NRPE Error

Posted: Thu Feb 21, 2019 2:36 pm
by cdienger
How exactly did you install the nrpe agent? The offical guide is at https://support.nagios.com/kb/article/n ... rpe-8.html. If you install via another means, uninstall and use this guide to set it up.

Verify it is up and listening with:

netstat -nap | grep 5666

Re: Getting Check NRPE Error

Posted: Thu Feb 21, 2019 4:37 pm
by ep7network
Hi @cdienger,

The way I installed nrpe agent from nagios server I entered yum --enablerepo=epel -y install nagios-plugins-nrpe. In the past I've installed nrpe agent in this way and it has worked with no issues. If nrpe is the reason why nagios monitroing service is not working then I will uninstall nrpe. I really don't like uninstalling stuff on CentOS 7. Every time I uninstall a service another program stops working. What is the correct way to uninstall nrpe?

I'm not 100% convince nrpe is the issue because when I enter netstat -nap | grep 5666 I do see port 5666 open and nrpe is listening. I'll attach pic.
also, when I enter service nrpe status I get output active running, and get a warning that Daemon is configured to accept command arguments from clients. I'll attach pic so you can see.

I did notice nagios web interface is now displaying a new error message from a CentOS 7 machine I want monitored, and the new error is (No output stdout) stderr: connect to address xxx.xxx.x.xxx port 5666: Connection refused. Before the error was CHECK_NRPE: Error - Could not connect to xxx.xxx.x.x: Conection reset by peer.

Re: Getting Check NRPE Error

Posted: Thu Feb 21, 2019 5:04 pm
by cdienger
It sounds like there may be a firewall blocking tcp port 5666. Run the following on the XI command line to check:

nmap ubuntu_machine_ip -p 5666

Re: Getting Check NRPE Error

Posted: Thu Feb 21, 2019 6:22 pm
by ep7network
Hi,

I ran nmap command and Ubuntu port 5666 does appear to be open. I attached pic.

I wonder what is causing this issue. My Windows machines are being monitored but none of my Linux servers aren't working. Then again nrpe isn't installed on Windows servers. I'm using NSCLient for Windows.

Re: Getting Check NRPE Error

Posted: Fri Feb 22, 2019 4:45 pm
by cdienger
Please provide the nrpe.cfg from the Ubuntu server so we can confirm the config.

Re: Getting Check NRPE Error

Posted: Fri Feb 22, 2019 8:35 pm
by ep7network
Hi there @cdienger,

Attached pic is nrpe.cfg from Ubuntu server.

Thank you for your time and assistance @cdienger.

Re: Getting Check NRPE Error

Posted: Mon Feb 25, 2019 3:51 pm
by npolovenko
@ep7network, On the Ubuntu nrpe server please navigate to /usr/local/nagios/libexec/ folder, run the following commands and show us the output:
./check_nrpe -H 127.0.0.1
And
./check_nrpe -H replace_with_the_ubuntu_server_internal_ip
Finally, please show me the output of ps -ef. You can upload the /tmp/support.txt file in this thread.
ps -ef > /tmp/suport.txt

Re: Getting Check NRPE Error

Posted: Mon Feb 25, 2019 6:10 pm
by ep7network
When I login to Ubuntu nrpe server. There is no directory for /usr/local/nagios/libexec.
If I go to /usr/lib/nagios/plugins I do see many check_xxxx commands but not check_nrpe!
On Ubuntu I can go to directory /etc/nagios/ and see nrpe.cfg file.

On Ubuntu, I ran ps -ef and I uploaded to this thread just in case.

From nagios server I ran ./check_ -H Ubuntu IP Address and received NRPE v2.15.

Re: Getting Check NRPE Error

Posted: Mon Feb 25, 2019 10:14 pm
by ep7network
Ubuntu host is up. Not exactly sure what I did but I do remember entering sudo /etc/init.d/nagios-nrpe-server restart and then going to Nagios server and entering check_nrpe -H Ubuntu-IP-Address and received output NRPE v2.15. I then looked at Nagios web interface and Ubunut is working.

Thank you @cdienger and @npolovenko for all your help.