title: Nagios External Commands WILL NOT WORK
body: <p>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 :)</p>
  
  <p>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.</p>
  
  <p>Here are the relevant deets:</p>
  
  <p>nagios.cfg </p>
  
  <pre><code>check_external_commands=1
  nagios_user=nagios
  nagios_group=nagios
  command_file=/usr/local/nagios/var/rw/nagios.cmd
  </code></pre>
  
  <p>I have changed the permissions and owners for this directory MANY times, nothing seems to work:
  ls -l /usr/local/nagios/var/rw</p>
  
  <p><code>prwxrwxrwx. 1 nagios nagcmd 0 Jan 29 21:27 nagios.cmd
  srw-rw----. 1 nagios nagcmd 0 Jan 29 14:09 nagios.qh</code></p>
  
  <p>I added users to groups that they don't really need to be in to no avail:
  cat /etc/group: </p>
  
  <pre><code>nagcmd:x:505:nagios,nagiosadmin,apache
  nagios:x:501:nagios,apache,nagiosadmin
  </code></pre>
  
  <p>The script is pointed to the correct file paths but again it won't work from the GUI anyway.</p>
  
  <pre><code>infra2 nagios: Error: External command failed -&gt; 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
  </code></pre>
  
  <p>I know this isn't the root of the problem as nothing works from command line but:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>GUI error I'm tired of seeing:
  "Sorry, but you are not authorized to commit the specified command...yada"</p>
  
  <p>What am I missing?!?! Please help! and thanks in advance</p>