Monday, December 26, 2011

Sorry, but Nagios is currently not checking for external commands


Sorry, but Nagios is currently not checking for external commands

You probably saw following message “Sorry, but Nagios is currently not checking for external commands, so your command will not be committed” when you tried to reschedule a service check in nagios web interface. The reason behind this is that nagios by default does not check for external commands. To resolve that problem we need to reconfigure nagios.
To enable checking for external commands we have to edit main nagios configuration file nagios.cfg, which is usually located in /etc/nagios3. You have to change below line
check_external_commands=0
to
check_external_commands=1
and reload nagios using
/etc/init.d/nagios3 reload
When you try again to reschedule service check from web interface the following error can come up: Error: Could not stat() command file '/var/lib/nagios3/rw/nagios.cmd'!. This is because of the bug in Debian, which is described here http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571801. The solution is quite simple:
# /etc/init.d/nagios3 stop 
Stopping nagios3 monitoring daemon: nagios3Waiting for nagios3 daemon to die... 
. 
# 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 
Starting nagios3 monitoring daemon: nagios3. 

No comments: