Can't set downtime from web interface


When I try to schedule a downtime via the web interface I get the following error:

Error: Could not stat() command file ‘/usr/local/nagios/var/rw/nagios.cmd’!

I think I’ve done everything according to the manual but I guess I’ve missed something.

I’ve added these lines to httpd.conf

ScriptAlias /nagios/cgi-bin/ “/usr/local/nagios/sbin/”
’<‘Directory “/usr/local/nagios/sbin/”’>‘
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all

Alias /nagios “/usr/local/nagios/share/”
’<‘Directory “/usr/local/nagios/share”’>‘
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

I’ve created /usr/local/nagios/share/.htaccess and /usr/local/nagios/sbin/.htaccess with

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
require valid-user

I’ve created /usr/local/nagios/etc/htpasswd.users with
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

I have created a group, nagioscmd, where I put both nagios and apache in.

The permissions of the /usr/local/nagios/var/rw directory is drwxrwsrwx.

In cgi.cfg I set the following

I’ts pretty much a standard installation. I’m running version 2.0b2. Everything else works.

Does anyone have any ideas?


does the /usr/local/nagios/var/rw/nagios.cmd file exist and has it the right acess privileges? and it’s parent directory?



The rw directory:
drwxrwsrwx 2 nagios nagioscmd 4096 Aug 22 14:00 rw

and nagios.cmd:
prw-rw---- 1 nagios nagioscmd 0 Aug 22 14:00 nagios.cmd

It doesn’t matter if I change the settings for nagios.cmd with chmod. Everytime I restart the nagios service it recreates the file.


If you did it by the book, your group would have been named “nagiocmd”, so I suspect that at some point, you may have used a copy/paste from the manual, and your name is different.

Double check your /etc/group for "nagioscmd"
double check your rw permissions for nagioscmd
double check who runs the httpd, is it apache and group apache?

From what you have posted, there is nothing wrong with what you have setup. Selinux firewall running?


Post the output of ldd.
ldd cmd.cgi => /usr/lib/mysql/ (0x0011d000) => /lib/tls/ (0x008a9000) => /lib/ (0x03655000) => /lib/ (0x006aa000) => /lib/tls/ (0x009d4000) => /usr/lib/ (0x00397000)
/lib/ (0x00890000)



ls -al /usr/local/nagios/var
drwxrwsrwx 2 nagios nagioscmd 4096 Aug 22 14:00 rw

User apache
Group apache

Firewall is disabled.

ldd /usr/local/nagios/sbin/cmd.cgi => /lib/tls/ (0x00297000)
/lib/ (0x0027d000)