Page 1 of 1

Failed to stop nrpe service in Oracle Linux

Posted: Wed Sep 18, 2019 3:08 am
by admincauce
Good morning,

I have the following problem that I don't know how to solve it.

I have an Oracle 6 Linux server, where I have the nrpe service installed to perform certain checks on that machine.
I had to add some new checks and modify others that we already had, and when it comes to stopping and starting the nrpe service I get the following error:

[root @ cnfora00 ~] # service nrpe restart
Shutting down nrpe [FAILED]
Starting nrpe [OK]

The service stop fails, and therefore I do not see the changes I have made to the server for new checks.

Where is the problem?

I've been watching but I don't see much else. Nothing else was touched in the nrpe.cfg file that may be in conflict.

Thank you very much in advance.

Re: Failed to stop nrpe service in Oracle Linux

Posted: Wed Sep 18, 2019 11:36 am
by benjaminsmith
Hello @admincauce,

Do you recall how you installed NRPE in this server? Did you compile from source or use the install script? NRPE can be configured to either run as a service under xinetd or as its own service in init.d.

What is the output of the following?

Code: Select all

ls -l /etc/xinetd.d

Re: Failed to stop nrpe service in Oracle Linux

Posted: Thu Sep 19, 2019 10:17 am
by admincauce
Thank you very much in advance,

I installed the NRPE service through official repositories by doing a yum install.

The output of the command you have given me is the following:

[root @ cnfora00 ~] # ls -l /etc/xinetd.d
total 4
-rw-r - r--. 1 root root 332 Aug 16 2014 rsync

I have NRPE as a service executed from init.d

Thanks in advance!

Re: Failed to stop nrpe service in Oracle Linux

Posted: Thu Sep 19, 2019 3:01 pm
by benjaminsmith
Hello @admincauce,

Let's enable the debug mode in the configuration file, then try to re-start and check the logs for messages.

1. Go to /usr/local/nagios/etc/nrpe.cfg and enable debugging.

Code: Select all

debug=0
#to
debug=1
2. Check to see if there are any NRPE processes running and kill them.

Code: Select all

ps -ef | grep nrpe | grep -v grep
Run the following if you see any processes.

Code: Select all

killall -9 nrpe
3. Restart NRPE

Code: Select all

service nrpe restart
If it doesn't restart please post the logs for us to review. Thanks.

Code: Select all

tail -n 25 /var/log/messages

Re: Failed to stop nrpe service in Oracle Linux

Posted: Fri Sep 20, 2019 4:37 am
by admincauce
Hi

And thank you very much for the answer.

Here is the log that I have at the time of restarting the service:

Sep 20 10:33:35 cnfora10 nrpe [21740]: Unable to open config file '/etc/nagios/nrpe_local.cfg' for reading
Sep 20 10:33:35 cnfora10 nrpe [21740]: Continuing with errors ...
Sep 20 10:33:35 cnfora10 nrpe [21740]: Could not open config directory '/etc/nagios/nrpe.d' for reading.
Sep 20 10:33:35 cnfora10 nrpe [21740]: Continuing with errors ...
Sep 20 10:33:35 cnfora10 nrpe [21740]: INFO: SSL / TLS NOT initialized. Network encryption DISABLED.
Sep 20 10:33:35 cnfora10 nrpe [21741]: Starting up daemon
Sep 20 10:33:35 cnfora10 nrpe [21741]: There's already an NRPE server running (PID 11692). Bailing out ...
Sep 20 10:33:43 cnfora10 nrpe [22296]: CONN_CHECK_PEER: checking if host is allowed: 10.203.228.6 port 63111
Sep 20 10:33:43 cnfora10 nrpe [22296]: is_an_allowed_host (AF_INET): is host> 10,203,228.6 <an allowed host> 10,203,228.6 <
Sep 20 10:33:43 cnfora10 nrpe [22296]: is_an_allowed_host (AF_INET): is host> 10,203,228.6 <an allowed host> 10,203,228.6 <
Sep 20 10:33:43 cnfora10 nrpe [22296]: is_an_allowed_host (AF_INET): is host> 10,203,228.6 <an allowed host> 10,203,228.6 <
Sep 20 10:33:43 cnfora10 nrpe [22296]: is_an_allowed_host (AF_INET): host is in allowed host list!


There are two errors at the beginning "unable to open config file" and indeed in / etc / nagios I don't have those files, I have the following files:

[root @ cnfora10 nagios] # ls -lh / etc / nagios /
total 28K
-rw-r - r--. 1 root root 9.4K Sep 20 10:29 nrpe.cfg
-rw-r - r--. 1 root root 13K Oct 16 2018 nrpe.cfg.rpmnew
 
The nrpe.cfg file is where I have the correct configuration and where I have all the checks for the server.

Regards

Re: Failed to stop nrpe service in Oracle Linux

Posted: Fri Sep 20, 2019 7:01 am
by scottwilkerson
Do you have the specified as includes?

Code: Select all

grep include /etc/nagios/nrpe.cfg