nagios-nrpe-server service will not stay running

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
baymer
Posts: 4
Joined: Thu Mar 03, 2016 11:19 am

nagios-nrpe-server service will not stay running

Post by baymer »

I recently started setting up Nagios at my work. I installed Nagios core 4.1.1 on a Debian 7 system to be my monitoring server and it is working great. I installed nagios-nrpe-server and nagios-plugins on the Debian hosts I want to monitor and configured nrpe.cfg to allow my monitoring host. This all seems to be working. I can see the hosts on the web interface and the default sercie checks that come with Nagios are working good. I started looking into doing some custom checks when I ran into an issue. When I run ./check_nrpe against one of my hosts, I get the response "connect to host xxx.xxx.x.xx port 5666: Connection refused". On the host servers if I run the commands "sudo service nagios-nrpe-server restart" or "sudo /etc/init.d/nagios-nrpe server restart" I get the response [ ok ] Staring nagios-nrpe: nagios-nrpe. But, if I try to see the status of the service it says "[FAIL] nagios-nrpe is not running ... failed!". I checked nrpe.pid and found that it does get updated with a new pid every time I attempt to start the service. The best way I can describe the issue is that the nrpe service starts but then immediately dies. Any help would be greatly appreciated.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: nagios-nrpe-server service will not stay running

Post by hsmith »

How did you install NRPE? Can you post the output of this command run on the machine with NRPE.

Code: Select all

 netstat -pan | grep 5666
Former Nagios Employee.
me.
baymer
Posts: 4
Joined: Thu Mar 03, 2016 11:19 am

Re: nagios-nrpe-server service will not stay running

Post by baymer »

Results of netstat - pan | grep 5666

tcp 0 0 172.16.0.10:4506 66.188.18.166:55666 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.142:56667 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.137:56668 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.91:55666 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.105:56661 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.105:56665 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.10:56665 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.38:55666 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.137:56666 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.139:56660 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.58:56662 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 66.188.18.166:56660 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.4:56666 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.117:56666 ESTABLISHED -
tcp 0 0 172.16.0.10:4506 172.16.4.142:56662 ESTABLISHED -
baymer
Posts: 4
Joined: Thu Mar 03, 2016 11:19 am

Re: nagios-nrpe-server service will not stay running

Post by baymer »

I installed with apt-get install nagios-plugins nagios-nrpe-server.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: nagios-nrpe-server service will not stay running

Post by rkennedy »

What is the output of getenforce?

It doesn't look like your NRPE service is listening properly on the debian machine. Can you attempt to start it, then run a tail -n500 /var/log/messages | grep 'nrpe' and post the result?
Former Nagios Employee
baymer
Posts: 4
Joined: Thu Mar 03, 2016 11:19 am

Re: nagios-nrpe-server service will not stay running

Post by baymer »

I found the issue was actually a problem with my nrpe.cfg file. Specifically the server_address line. I ended up commenting it out and the nrpe starts and continues to run correctly now. Thanks for the help.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: nagios-nrpe-server service will not stay running

Post by rkennedy »

Glad to see you were able to solve this!

I'll go ahead and close this thread out now, but feel free to open a new one if you need assistance in the future.
Former Nagios Employee
Locked