Activate nagios external commands

At default the external commands for nagios are deactivated. To activate them, we have to adapt the nagios configuration.

I write just a short command summary. The whole documentation can be found at /usr/share/doc/nagios3/README.Debian. First of all we need to activate external commands for nagios. That can be done with setting check_external_commands to 1 in nagios.cfg:

vi /etc/nagios3/nagios.cfg
...
check_external_commands=1
...

After that we need to change directory permissions and make the changes permament (all commands need to be executed as root):

service nagios3 stop
dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
service nagios3 start

The specific part in README.Debian:

Nagios 3 is not configured to look for external commands in the
default configuration as a security feature. To enable external
commands, you need to allow the web server write access to the
nagios command pipe.  the simplest way of doing this is to
set check_external_commands=1 in your nagios configuration,
and then change the permissions in a way which will be maintained
across package upgrades (otherwise dpkg will overwrite your
permission changes).  The following is the recommended approach:

- activate external command checks in the nagios configuration. this
  can be done by setting check_external_commands=1 in the file
  /etc/nagios3/nagios.cfg.

- perform the following commands to change directory permissions and
  to make the changes permanent:

/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
comments powered by Disqus