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
’<’/Directory’>’

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

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
use_authentication=1
default_user_name=nagiosadmin
authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin

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?

Luca

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
libmysqlclient.so.14 => /usr/lib/mysql/libmysqlclient.so.14 (0x0011d000)
libc.so.6 => /lib/tls/libc.so.6 (0x008a9000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x03655000)
libnsl.so.1 => /lib/libnsl.so.1 (0x006aa000)
libm.so.6 => /lib/tls/libm.so.6 (0x009d4000)
libz.so.1 => /usr/lib/libz.so.1 (0x00397000)
/lib/ld-linux.so.2 (0x00890000)

/etc/group
nagioscmd:x:501:apache,nagios

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

/etc/httpd/conf/httpd.conf
User apache
Group apache

Firewall is disabled.

ldd /usr/local/nagios/sbin/cmd.cgi
libc.so.6 => /lib/tls/libc.so.6 (0x00297000)
/lib/ld-linux.so.2 (0x0027d000)