Page 1 of 1

NPRE DEAD BUT SUBSYS LOCKED ERROR

Posted: Fri Apr 17, 2015 6:17 pm
by pleegor
Hello everyone,

I am trying to setup nagios nrpe monitoring, everything looks good and when I run config check I get 0 errors. However, a disk check that is going through NRPE plugin, throws me the following error:

Code: Select all

Connection refused by host



iptables look good and nothing is blocked:

Code: Select all


target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
When I tried to check status of nrpe I got the following:

Code: Select all

 
/etc/init.d/nrpe status
nrpe dead but subsys locked
I tried to remove /var/run/*.pid and /var/lock/subsys/* , but the same error still exists.

I am running Negios Core 4.0.8 both client and server are running on CentOS 6.5

Thanks for your help in advance!

Re: NPRE DEAD BUT SUBSYS LOCKED ERROR

Posted: Mon Apr 20, 2015 10:49 am
by jolson
Where does the following error come from:

Code: Select all

/etc/init.d/nrpe status
nrpe dead but subsys locked
Is that on the client machine, or the Nagios server?

Can you please run the following commands as the Nagios user on the box where NRPE will not start properly:

Code: Select all

ulimit -a
ps | grep -v PID |grep -v grep | wc -l
It's possible that the nagios user has hit the 'max user processes' limit.

Does this error happen if the nagios user tries to run any other process?

Are there any log messages in /var/log/messages?

Re: NPRE DEAD BUT SUBSYS LOCKED ERROR

Posted: Tue Mar 22, 2016 2:47 pm
by karan chauhan
While I was starting nrpe service , i was getting "nagios dead but subsys locked"

**Resolution 1: In that case I tried to delete nrpe.pid under /var/run/nrpe and lock file under /var/lock/subsys - But it has not solved my problem
Then I checked the logs under /var/log/messages because nagios was not creating separate log file and observed as below:**

*Mar 23 00:36:48 localhost kernel: readahead-collector: starting delayed service auditd
Mar 23 00:36:49 localhost auditd[1273]: Started dispatcher: /sbin/audispd pid: 1275
Mar 23 00:36:49 localhost audispd: No plugins found, exiting
Mar 23 00:36:49 localhost auditd[1273]: Init complete, auditd 2.0.4 listening for events (startup state enable)
Mar 23 00:36:49 localhost kernel: readahead-collector: sorting
Mar 23 00:36:49 localhost kernel: readahead-collector: finished
Mar 23 00:38:59 localhost nrpe[1349]: Starting up daemon
Mar 23 00:38:59 localhost nrpe[1349]: Cannot write to pidfile '/var/run/nrpe/nrpe.pid' - check your privileges.
Mar 23 00:38:59 localhost nrpe[1349]: Bind to port 5666 on 192.168.137.2 failed: Cannot assign requested address.
Mar 23 00:38:59 localhost nrpe[1349]: Cannot bind to any address.*


**From the log file it was clear that nagios was not able to write .pid , I observed that nrpe directory was deleted accidentally , I created it manually under /var/run
After That, I again restarted nrpe but got same error, I observed the logs again:**

*Mar 23 00:50:26 localhost nrpe[1502]: Starting up daemon
Mar 23 00:50:26 localhost nrpe[1502]: Bind to port 5666 on 192.168.137.2 failed: Cannot assign requested address.
Mar 23 00:50:26 localhost nrpe[1502]: Cannot bind to any address.
Mar 23 00:51:22 localhost nagios: SERVICE ALERT: localhost;HTTP;CRITICAL;HARD;4;connect to address 127.0.0.1 and port 80: Connection refused*


**Solution : Then I opened the /etc/nagios/nrpe.cfg file and changed the server address to nagios client IP as below(By mistake I had mentioned the nagios server address i.e 192.168.137.2):
server_address=192.168.137.3**

**Restarted the nrpe service and it got restarted successfully**

Logs output:
*Mar 23 00:52:13 localhost nrpe[1526]: Starting up daemon
Mar 23 00:52:13 localhost nrpe[1526]: Server listening on 192.168.137.3 port 5666.
Mar 23 00:52:13 localhost nrpe[1526]: Listening for connections on port 0
Mar 23 00:52:13 localhost nrpe[1526]: Allowing connections from: 192.168.137.2*

Re: NPRE DEAD BUT SUBSYS LOCKED ERROR

Posted: Tue Mar 22, 2016 2:52 pm
by tmcdonald
Thank you for the input, however as this thread is quite old I will be closing it now.