CGI Whoops Message on RHEL
Demetri Mouratis
dmourati at cm.math.uiuc.edu
Sat Sep 10 01:09:11 CEST 2005
On Fri, 9 Sep 2005, Demetri Mouratis wrote:
> Hi,
>
> I'm in the process of doing a platform change from a generic Linux to Red Hat
> Enterprise Linux 3 ES. On the new platform, I can't get the CGIs to work at
> all. I get the:
>
> Whoops!
>
> Error: Could not read host and service status information!
>
> whenever I try to invoke a cgi from the web browser. The nagios process is
> running:
>
> [root at ops-db1 root]# ps -aef f | grep -i nagios|grep -v grep
> nagios 6524 1 0 15:08 ? S 0:00 /usr/bin/nagios -d
> /etc/nagios/nagios.cfg
>
> I'm using nagios 1.2 from dag:
>
> [root at ops-db1 cgi]# rpm -q nagios
> nagios-1.2-0.rhel3.dag
>
> The users are set up correctly:
>
> [root at ops-db1 root]# id apache
> uid=48(apache) gid=48(apache) groups=48(apache),903(nagios)
> [root at ops-db1 root]# id nagios
> uid=903(nagios) gid=903(nagios) groups=903(nagios)
>
> [root at ops-db1 nagios]# ls -lah
> total 104K
> drwx------ 6 nagios nagios 4.0K Sep 9 15:16 .
> drwxr-xr-x 8 root root 4.0K Sep 8 12:33 ..
> drwxr-xr-x 2 nagios nagios 4.0K Feb 11 2004 archives
> -rw------- 1 nagios nagios 148 Sep 9 15:13 .bash_history
> -rw-r--r-- 1 nagios nagios 24 Sep 8 00:56 .bash_logout
> -rw-r--r-- 1 nagios nagios 191 Sep 8 00:56 .bash_profile
> -rw-r--r-- 1 nagios nagios 124 Sep 8 00:56 .bashrc
> -rw-rw-r-- 1 nagios nagios 0 Sep 9 15:08 comment.log
> -rw-rw-r-- 1 nagios nagios 0 Sep 9 15:08 downtime.log
> drwx------ 2 nagios nagios 4.0K Sep 9 15:17 .gnupg
> -rw-rw-r-- 1 nagios nagios 44K Sep 9 15:14 nagios.log
> drwxr-sr-x 2 nagios apache 4.0K Sep 9 15:08 rw
> drwx------ 2 nagios nagios 4.0K Sep 9 12:18 .ssh
> -rw-rw-r-- 1 nagios nagios 7.9K Sep 9 15:16 status.log
> -rw-rw-r-- 1 nagios nagios 5.9K Sep 9 15:08 status.sav
>
> I started thinking the problem may have something to do with exec shield
> which Red Hat added in Update 3 so I disabled it:
>
> [root at ops-db1 nagios]# echo 0 > /proc/sys/kernel/exec-shield
> [root at ops-db1 nagios]# echo 0 > /proc/sys/kernel/exec-shield-randomize
>
> I can get the CGIs to work just fine from the command line:
>
> [root at ops-db1 cgi]# ./avail.cgi
> Cache-Control: no-store
> Pragma: no-cache
> Last-Modified: Fri, 09 Sep 2005 22:18:54 GMT
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Content-type: text/html
>
> <html>
> <head>
> <title>
> Nagios Availability
> </title>
> <LINK REL='stylesheet' TYPE='text/css' HREF='/nagios/stylesheets/avail.css'>
> </head>
> <BODY CLASS='avail'>
>
> <snip>
>
> This is driving me crazy at the moment so I'm hoping I've overlooked
> something obvious. Any help is greatly appreciated as I'm getting sick of
> wrestling with this one.
>
> Thanks.
>
Sorry to reply to my own post but this is now fixed. It turned out that a
another developer had modified the permissions on /var/log/nagios making
it impossible for the CGI's to access the status and log files. For the
record, 750 perms worked just fine in my config.
Thanks.
---------------------------------------------------------------------
Demetri Mouratis
dmourati at linfactory.com
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list