Odd problem with permissions


#1

I have Nagios running fine. All of my orginal settings work fine and everything is being checked like i want. I can make adjustments to services.cfg and other cfg files and restart nagios without issue.

Until I added a new host. I created thenew host and added it to the appropriate host group. The new host appears perfectly in the scheduling que and even shows its status as “ok”. The problem is it will not appear in host group overview and when I click on it I get the “It appears as though you do not have permission to view information for this host…”. I am logging in as the only user thats been entered “nagiosadmin” and have set that user for all of the access permissions in cgi.cfg . I also made sure the nagiosadmin is listed as the contact for all host groups. I can access everything else without problems just this one newly added host.


#2

You may have a typo in your configs. Double check everything. Also, try using the -v option to test nagios configs before starting nagios.


#3

I am running Nagios 2.0b4 from RPM on Fedora FC3 and httpd-2.0.53-3.3.
I am having the same problem. No errors with -v, the server runs just fine but the Login As: shows: ‘?’ as my username.


#4

Then you haven’t actually authenticated if your name is ?
You are also repeating yourself if you are the same “anonymous” as the other thread with this same authentication problem. Please dont do that, since it’s annoying to answer the same question by the same peron in mulitple threads.
Follow step by step again please:
nagios.sourceforge.net/docs/2_0/cgiauth.html


#5

I found the problem. Not believing nagios ignores invisible chars etc, I kept going and dig more. I believe other people are having the same problem as well due to the same cause.

Debugging it:
The httpd log shows that sometimes I have username and sometimes I do not. This was a clue. A simple check of environmental variables as shown in devdaily.com/perl/edu/articl … 0001.shtml light up the problem.

Here is the underlying problem:
I installed my nagios from RPM and follow the instructions in nagios.sourceforge.net/docs/2_0/cgiauth.html .
The RPM Install cgi-bin in /usr/lib/nagios and the documentation in /usr/share/nagios. The cgauth.html link above tell users to create .htaccess in the /usr/share/nagios/ and not in /usr/lib/nagios/cgi/. This resulting to no access or “Login as: ?”.

The fix:
put the .htaccess file where your cgi is. For RPM users this means: /usr/lib/nagios/cgi

Suggestion:
It may be a good idea that someone add a note in the cgiauth.html to remind user to put .htaccess where cgi files should be. Not where documentation is. After all we want to protect access to CGI files not documentation which is freely available in the net.


#6

That doc for the install clearly states where to put the files. It also states that you may want to protect not only cgi by html files, which is not a bad idea. The problems you seem to have encountered look to come from the fact you installed from an RPM and the docs are for source installations.