I’ve just finished reading through the posts i’ve found searching for external commands information.
I’ve walked through the Nagios docs on setting up permissions for the rw folder, for the nagios.cmd file. Nagios is creating the .cmd file successfully, but apache isn’t liking it too much.
I get the following error when trying to process any of the host commands…
Error: Could not stat() command file ‘/usr/local/nagios/var/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.
The RW folder and its permissions
drwxrwsr-x 2 nagios nagiocmd 4096 Jul 6 17:21 rw
The files inside rw
drwxrwsr-x 2 nagios nagiocmd 4096 Jul 6 17:21 .
drwxrwxr-x 4 nagios nagios 4096 Jul 6 17:22 …
-rwxr-xr-x 1 nagios nagiocmd 901 Jul 6 15:51 disable_active_service_checks
-rwxr-xr-x 1 nagios nagiocmd 825 Jul 6 15:51 disable_notifications
-rwxr-xr-x 1 nagios nagiocmd 900 Jul 6 15:51 enable_active_service_checks
-rwxr-xr-x 1 nagios nagiocmd 826 Jul 6 15:51 enable_notifications
-rwxr-xr-x 1 nagios nagiocmd 2036 Jul 6 15:51 handle-master-host-event
-rwxr-xr-x 1 nagios nagiocmd 1232 Jul 6 15:51 handle-master-proc-event
prw-rw---- 1 nagios nagiocmd 0 Jul 6 17:21 nagios.cmd
-rwxr-xr-x 1 nagios nagiocmd 1179 Jul 6 15:51 obsessive_svc_handler
-rwxr-xr-x 1 nagios nagiocmd 1182 Jul 6 15:51 submit_check_result
-rwxr-xr-x 1 nagios nagiocmd 1207 Jul 6 15:51 submit_check_result_via_nsca
Please help
On a side note, i’ve also had a problem with apache and the cgi files. I had to move the cgi files to /var/www/cgi-bin and recompile to reflect the changes in order for it to work. No matter what permissions i applied to /usr/local/nagios/sbin and the related files, they would not allow executable access to apache. So, this could be the same thing unfortunately.