Cgi.cfg reading errors

Andreas Ericsson ae at op5.se
Sun Mar 28 13:22:58 CEST 2004


Dan Adams wrote:
> Andreas,
> 	I tried that, su to root first then su to both of the users, what
> Nagios is and what the web server is. 

Only the webserver user needs read-access to the files, and it's path 
will not be relative to DocumentRoot.

You can do the following to see what files it's trying to open and what 
happens when it does. First su to the webserver pseudo-user, then run 
this little sequence;
export REQUEST_METHOD=GET
export QUERY_STRING="host=all"
export REMOTE_USER="some-authorized-user"

strace <cgi-program> 2>&1 | grep open | less

You will obviously have to replace some-authorized-user with an 
authorized user, and the 'host=all' string may not work with all CGI's.

If you still can't work it out, post the output of the strace-command 
here and I'll probably be able to help you.

> When I did the cat on that filename it
> listed the file perfectly fine from both of those users. I also tried
> restarting the web server in the event that chmodding the file to 777 would
> help.

Restarting it after chmod'ing it can't possibly help, since the files 
are accessed on run-time by the cgi's.

> 	Also, I will ask, in which directory should the nagios.cfg file be
> in, I did not see it below the /usr/local/nagios directory tree?
> 
In /usr/local/nagios/etc by default.

> Dan
> 
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net
> [mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Andreas
> Ericsson
> Sent: Saturday, March 27, 2004 1:23 PM
> To: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Cgi.cfg reading errors
> 
> 
> 
> 
> Dan Adams wrote:
> 
>>I have Nagios setup and running on a Unix environment computer, I have 
>>the cgi.cfg file chmoded to 777, just to make sure it can work, 
>>however I am still getting an error message saying that the file 
>>cannot be opened for reading on most of the pages in the website. I do 
>>have the website working, but I cannot get this file (At least, but 
>>the other *.cfg files may have errors also). I was wondering, at first 
>>at least, does any one know of any FAQ pages or such that may help 
>>with this error? I will gladly read through any suggestions that can 
>>come my way to help. Any information will be greatly appreciated.
>>
> 
> Log on to the system as the user nagios and the web-server is running 
> and and try to 'cat' the file.
> 
> If you can, I'm pretty sure you've made a typo or something in 
> nagios.cfg, or that you have moved your nagios installation to some 
> other directory than you initally had it (--prefix option to ./configure).
> 
> If you can't (which I think might be the case), the user may not have 
> execute permissions for one or more of the directories above it in the 
> path (execute permissions on unix-systems means 'access to files and 
> directories in it', whereas reading permissions means 'access to 
> directory listing when coupled with execute permissions', basically).
> 
> 

-- 
Mvh
Andreas Ericsson
OP5 AB
+46 (0)733 709032
andreas.ericsson at op5.se


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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