Categories
Linux Software

Failed to obtain lock on file /var/run/nagios.pid: Permission denied

This error is caused by Nagios not having access to the folder where it should save it`s PID file. You can change the path for the PID file (and then also fixing the issue) by editing your nagios.conf (usually /etc/nagios/nagios.conf).

Locate the lock_file setting:

lock_file=/var/run

And change it to another path, like for example /tmp.

Start up Nagios again and it should be much happier 🙂

3 replies on “Failed to obtain lock on file /var/run/nagios.pid: Permission denied”

mkdir /var/run/nagios
chown nagios:nagios /var/run/nagios

lock_file=/var/run/nagios

And report a bug for your distro 🙂

I just faced the similar issue and created nagios.lock file manually, changed permissions and ownership. That worked for me fine.

location of file:

/usr/local/nagios/var
touch nagios.lock
chmod 664 nagios.lock
chown root:nagiosops nagios.lock

Comments are closed.