I've been banging my head against the wall for the past few days on this and promise I looked everywhere. If I'm wrong please teach me with a link :)
I'm trying to schedule downtime for some services and haven't been able to make it happen via the command line or the web GUI. For some reason the only thing I can do is commit host comments/downtime via the GUI and nothing else anywhere else. I should also mention that a cronjob of the scheduled downtime will show up in the Nagios web interface comments, but still doesn't work. The only difference I notice is the author as indicated by the GUI for host down time is "nagiosadmin" and of the non-working downtimes is "nagios" I did try chown'ing file paths with nagiosadmin.
Here are the relevant deets:
nagios.cfg
check_external_commands=1
nagios_user=nagios
nagios_group=nagios
command_file=/usr/local/nagios/var/rw/nagios.cmd
I have changed the permissions and owners for this directory MANY times, nothing seems to work: ls -l /usr/local/nagios/var/rw
prwxrwxrwx. 1 nagios nagcmd 0 Jan 29 21:27 nagios.cmd
srw-rw----. 1 nagios nagcmd 0 Jan 29 14:09 nagios.qh
I added users to groups that they don't really need to be in to no avail: cat /etc/group:
nagcmd:x:505:nagios,nagiosadmin,apache
nagios:x:501:nagios,apache,nagiosadmin
The script is pointed to the correct file paths but again it won't work from the GUI anyway.
infra2 nagios: Error: External command failed -> SCHEDULE_HOST_DOWNTIME;deploy1;1422507601;1422536401;0;28800;neo-nagios;Scheduled Daily Downtime (low usage period) Jan 29 21:27:20 infra2 nagios: External command error: Command failed
I know this isn't the root of the problem as nothing works from command line but:
ls -l /usr/local/nagios/etc/cgi.cfg -rw-rw-r--. 1 nagios nagios 12015 Jan 29 14:06 /usr/local/nagios/etc/cgi.cfg
ls -l /usr/local/nagios/sbin/cmd.cgi -rwxrwxr-x. 1 nagios nagios 288424 Jan 28 10:17 /usr/local/nagios/sbin/cmd.cgi
GUI error I'm tired of seeing: "Sorry, but you are not authorized to commit the specified command...yada"
What am I missing?!?! Please help! and thanks in advance