Error: Could not stat() command file '/var/lib/nagios3/rw/nagios.cmd'!In order to fix it, do the following actions:
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.
Check that /etc/nagios3/nagios.cfg has:
check_external_commands=1
Also check that
command_check_interval=15s is uncommented and
command_check_interval=-1 is commented like this:
command_check_interval=15sCheck the path for command_file is OK. It usually looks like this:
#command_check_interval=-1
command_file=/var/lib/nagios3/rw/nagios.cmdMake sure that the user www-data is part of the nagios group - this is located in /etc/group
Check permissions on the command file that we looked at above:
# ls -l /var/lib/nagios3/rw/nagios.cmdIf it looks like this, we're good.
prw-rw---- 1 nagios nagios 0 Mar 7 11:56 /var/lib/nagios3/rw/nagios.cmd
The next thing to check is that the directory that nagios.cmd resides in has executable rights for the nagios group:
# ls -l /var/lib/nagios3/Uh oh - rw has no group rights! Fix it with this command:
total 180
-rw------- 1 nagios www-data 176049 Mar 7 11:58 retention.dat
drwx------ 2 nagios www-data 4096 Mar 7 11:56 rw
drwxr-x--- 3 nagios nagios 4096 Jun 14 2013 spool
# chmod g+x /var/lib/nagios3/rwand then
# service nagios3 restartAnd the crowd goes wild!
Weird I still get the same error after doing all these steps. Will have to investigate further then. :) Thanks for a good guide anyway.
ReplyDeleteTry this then to fix it:
ReplyDelete# 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