Wednesday, August 11, 2010

Nagios3 on Debian external commands

Enabling external commands in nagios on a Debian deb install of nagios is a bit of a pain.

First in /etc/nagios3/nagios.cfg change
check_external_commands=1

Then you will get errors about
Error: Could not stat() command file '/var/lib/nagios3/rw/nagios.cmd'!

If you
rm /var/lib/nagios3/rw/nagios.cmd
chmod a+x /var/lib/nagios3
chmod g+s /var/lib/nagios3/rw
/etc/init.d/nagios restart

That error should go away and www-data should have read access to that file. You may need to
chgrp www-data /var/lib/nagios3/rw
But that was already there for me.