Nagios: Could not stat() command file /var/lib/nagios3/rw/nagios.cmd

All debian based distributions seem to have a problem with executing external commands after a default installation.
You might end up with an error like this:

Error: Could not stat() command file ‘/var/lib/nagios3/rw/nagios.cmd’!
The external command file may be missing, Nagios may not be running, and/or Nagios may not be checking external commands.
An error occurred while attempting to commit your command for processing.

You can fix this by running the following commands:

/etc/init.d/nagios3 stop
dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
/etc/init.d/nagios3 start

2 thoughts on “Nagios: Could not stat() command file /var/lib/nagios3/rw/nagios.cmd

Leave a Reply

Your email address will not be published.

*