nrpe service cannot start

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
Hui
Posts: 4
Joined: Wed Sep 20, 2017 9:36 pm

nrpe service cannot start

Post by Hui »

Hello,
When I start nrpe (3.2.1) service on Linux redhat 7.2 vlab, I encounter an error as follows.
[root@brdbjiantao-db-0 ~]# systemctl status nrpe
● nrpe.service - Nagios Remote Plugin Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2017-09-26 16:10:47 CST; 17h ago
Docs: http://www.nagios.org/documentation
Process: 18279 ExecStopPost=/bin/rm -f /var/log/nagios/nrpe.pid (code=exited, status=1/FAILURE)
Process: 18276 ExecStart=/usr/sbin/nrpe -c /etc/nrpe/nrpe.cfg -f (code=exited, status=2)
Main PID: 18276 (code=exited, status=2)

Sep 26 16:10:47 brdbjiantao-db-0 systemd[1]: Started Nagios Remote Plugin Executor.
Sep 26 16:10:47 brdbjiantao-db-0 systemd[1]: Starting Nagios Remote Plugin Executor...
Sep 26 16:10:47 brdbjiantao-db-0 nrpe[18276]: Warning: Cannot open log file '/var/log/nagios/nrpe.log' for writing
Sep 26 16:10:47 brdbjiantao-db-0 nrpe[18276]: Starting up daemon
Sep 26 16:10:47 brdbjiantao-db-0 nrpe[18276]: Cannot write to pidfile '/var/log/nagios/nrpe.pid' - check your privileges.
Sep 26 16:10:47 brdbjiantao-db-0 systemd[1]: nrpe.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 26 16:10:47 brdbjiantao-db-0 rm[18279]: /bin/rm: cannot remove ‘/var/log/nagios/nrpe.pid’: Permission denied
Sep 26 16:10:47 brdbjiantao-db-0 systemd[1]: nrpe.service: control process exited, code=exited status=1
Sep 26 16:10:47 brdbjiantao-db-0 systemd[1]: Unit nrpe.service entered failed state.
Sep 26 16:10:47 brdbjiantao-db-0 systemd[1]: nrpe.service failed.

Nagios has no privileges to make the directory /var/log/nagios or touch /var/log/nagios/nrpe.pid. How to fix this issue?
Looking forward to your reply.
Thanks a lot.
Hui
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: nrpe service cannot start

Post by npolovenko »

Hello, @Hui. Has your NRPE ever been working on this machine or did you just install it? Also, which installation guide did you use?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked