0

I have a similar problem like it was on question Memcached status returning "memcached dead but pid file exists" but I can't solve it.

My Nagios client is CentOS 6.4 and NRPE won't work after power outage (which forcedly stopped CentOS). When I type, I get the following:

/sbin/service nrpe status
nrpe dead but pid file exists

Also, file /var/run/nrpe.pid has the process id, but when trying to kill it, I get:

-bash: kill: (3879) - No such process

and on /var/lock/subsys/ I have empty nrpe file. So, please help me to solve this issue.

2
  • How did you install NRPE? epel repo? rf? compiled manually?
    – Keith
    Aug 21, 2013 at 16:11
  • No, throgh rpm, not manually.
    – Zoran
    Aug 23, 2013 at 10:18

2 Answers 2

1

When the NRPE shuts down cleanly, it's cleaning up the .pid file. That's why, if the pid file exists, the init script assumes the NRPE is still running.

But in your case you say the machine has just powered off, this means NRPE wasn't able to clean up it's pid file. This means now you can just remove the .pid file and start NRPE again.

9
  • Sorry, I didn't specified that I did that already, delete nrpe.pid and after that restart service. But, without success at all. Problem remains
    – Zoran
    Aug 21, 2013 at 12:55
  • 1
    Are you sure you are deleting the correct pid file? maybe you should verify by looking at the init script.
    – replay
    Aug 21, 2013 at 12:57
  • I am positive - /var/run/nrpe.pid - that is the file
    – Zoran
    Aug 21, 2013 at 13:01
  • please provide me with info in how to check it with init sscript - not sure where and what to check there
    – Zoran
    Aug 21, 2013 at 13:03
  • basically you have to find the definition of the path to the .pid file. somewhere in the init script there should be a line where it sets the location of the pid file, and this is probably the one it's using.
    – replay
    Aug 21, 2013 at 13:16
0

Can you delete the pid file (likely in /var/run)?

6
  • Yes, I can and did that already. But problem remains
    – Zoran
    Aug 21, 2013 at 12:56
  • Does "service npre stop" work? You may want to try running the command with strace so you can see what's happening. Aug 21, 2013 at 16:47
  • Thanks for a tip, but with strace -p command, answer is that such process does not exist (and on nrpe.pid file I have process number).
    – Zoran
    Aug 22, 2013 at 8:28
  • I am a little confused, does npre.pid exist or not? Can you update locatedb and make sure that there are no other pid files, perhaps its not in the default directory? Aug 22, 2013 at 12:47
  • .pid does exist but nrpe is "dead" according to meesage which I receive after asking for a status of nrpe process. Deleting, updating, restarting - doesn't help at all. I already tried everything (and reinstall nrpe, also) before I asked for a help here
    – Zoran
    Aug 23, 2013 at 6:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .