LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Nagios web login error..... (https://www.linuxquestions.org/questions/linux-software-2/nagios-web-login-error-258965/)

dwarf007 11-24-2004 05:24 PM

Nagios web login error.....
 
I had tried to login to the nagios apache web, but it comes out the below error.
Can i know what should i do now? Is the configuration error?

My nagios page.......
Code:

http://localhost/nagios/cgi-bin
Authentication required!

This server could not verify that you are authorized to access the URL "/nagios/cgi-bin". You either supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

In case you are allowed to request the document, please check your user-id and password and try again.

If you think this is a server error, please contact the webmaster

Error 401

localhost
Wed 24 Nov 2004 07:20:53 AM MYT
Apache/2.0.40 (Red Hat Linux)

david_ross 11-25-2004 01:29 PM

How id you configure the authentication using http basic auth and password files? Can you post your configuration for this. Did it work ok before you added the authentication?

btmiller 11-25-2004 05:14 PM

To add on to what David_Ross said, did you follow the directions in the Nagios documentation for how to set the ScriptAlias configure directive in your httpd.conf and then set the permissions for the /usr/local/nagios/sbin directory? I've been working on a nagios setup at work recently, and you need to be very sure that the directory attributes are set properly in Apache. There's a section in the Nagios documentation that tells you exactly how to do this.

dwarf007 11-27-2004 03:02 AM

These are the permission of the directory sbin, i think is ok...

Code:

[root@Linux-Nagios sbin]# ls -l
total 1624
-rwxrwxr-x    1 nagios  nagios    143824 Nov 23 02:54 avail.cgi
-rwxrwxr-x    1 nagios  nagios    144924 Nov 23 02:54 cmd.cgi
-rwxrwxr-x    1 nagios  nagios    113872 Nov 23 02:54 config.cgi
-rwxrwxr-x    1 nagios  nagios    160292 Nov 23 02:54 extinfo.cgi
-rwxrwxr-x    1 nagios  nagios    105764 Nov 23 02:54 history.cgi
-rwxrwxr-x    1 nagios  nagios    101604 Nov 23 02:54 notifications.cgi
-rwxrwxr-x    1 nagios  nagios      98072 Nov 23 02:54 outages.cgi
-rwxrwxr-x    1 nagios  nagios    100292 Nov 23 02:54 showlog.cgi
-rwxrwxr-x    1 nagios  nagios    145148 Nov 23 02:54 status.cgi
-rwxrwxr-x    1 nagios  nagios    114864 Nov 23 02:54 statuswml.cgi
-rwxrwxr-x    1 nagios  nagios    108792 Nov 23 02:54 statuswrl.cgi
-rwxrwxr-x    1 nagios  nagios    119184 Nov 23 02:54 summary.cgi
-rwxrwxr-x    1 nagios  nagios    123100 Nov 23 02:54 tac.cgi

These are the http.conf file configuration, i add on this two at the end of the http.conf file.....

Code:

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

Code:

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

I had a file htpasswd.users in /usr/local/nagios/etc
I had one file .htaccess in /usr/local/nagios/sbin and also in /usr/local/nagios/share

I had follow what is in the documentation. What else i am left behind or anythings go wrong?

Anyone knows, please help.........
Thank You.....

david_ross 11-27-2004 09:02 AM

Can you post the contents of .htaccess (just one if they are the same). Did you add users to your htpasswd file with "htpasswd"?

dwarf007 11-28-2004 04:46 AM

Thank You for the help.....

The problem is solved, but now i encounter another problem which is.

---------------------------------------------------------------------------
Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster

Error 403

linux-nagios
Sat 27 Nov 2004 06:42:03 PM MYT
Apache/2.0.40 (Red Hat Linux)
---------------------------------------------------------------------------

Can i know whats is the problem? The folder /usr/local/nagios/sbin originally only has cgi file inside and i had change all of them to 777 permission.

Anyone knows please help........
Thank You :)

david_ross 11-28-2004 12:51 PM

What url were you trying to access?

Can you post the last few lines from your error_log.

dwarf007 11-28-2004 02:02 PM

Thanks for the reply :)

The below are the "error_log" are from the directory /var/log/httpd/error_log

[Sun Nov 28 03:44:19 2004] [notice] caught SIGTERM, shutting down [Sun Nov 28 03:44:21 2004] [notice] Digest: generating secret for digest authentication ... [Sun Nov 28 03:44:21 2004] [notice] Digest: done [Sun Nov 28 03:44:22 2004] [notice] Apache/2.0.40 (Red Hat Linux) configured -- resuming normal operations [Sun Nov 28 03:44:46 2004] [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/local/nagios/sbin/

What going on actually?

M4tth3wV 11-28-2004 05:38 PM

Is there a reason why you have two "Alias" statements in your Apache config?

Also, does all this work when you don't enable htaccess?

dwarf007 11-29-2004 10:09 AM

Does it really matter where the httpd.conf has more than one Alias or ScriptAlias? I had more than 2 for both of them.

As what i saw from the configuration for httpd.conf at nagios support, they didnt ask to remove duplicate Alias and ScriptAlias.........

My major problem is cant view the page http://localhost/nagios/cgi-bin/

----------------------------------------------------------------------
Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster

Error 403

linux-nagios
Sun 28 Nov 2004 11:57:55 PM MYT
Apache/2.0.40 (Red Hat Linux)
-----------------------------------------------------------------------

In http://localhost/nagios/ , i had a problem of below function when i tried to access
- Status Map (Monitoring)
- Trends (Reporting)
- Alert Histogram (Reeporting)

-----------------------------------------------------------------------
Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster

Error 404

linux-nagios
Mon 29 Nov 2004 12:06:20 AM MYT
Apache/2.0.40 (Red Hat Linux)

-----------------------------------------------------------------------

Anyone knows, please help.
Thank You........

M4tth3wV 11-29-2004 11:48 AM

I'm not sure if having multiple Alias's matter or not, but I'd make my config as simple as possible. Remove restricted access, make apache exactly like the Nagios documentation.

I had some issues getting Nagios up, but it was more than worth it. It's been rock solid for over a year.

mnl 12-17-2004 03:40 AM

Hello,

I have been using nagios 1.1 on an Apache1.3 server for more than a year now with extreme satisfaction.

I recently updated to Apache 2.0.40 (standard issue on the flavor of Redhat I have installed) and I cannot get the authentication to work...

Nagios' CGIs run just fine, but the authentication does not. If I activate it (either with .htaccess or a <Directory> tag inside httpd.conf) and I try browsing to Nagios, the requester popup does _not_ show, but I get an "Authorization required" message from Apache as though I had tried to log in and failed. I mean, Apache doesn't even give me a try!

I am very sure I replicated my working configuration but it just doesn't work as expected.

I appreciate any help you can give me on this.

Thanks! :)

mnl 12-17-2004 04:26 AM

All right, problem solved. I had to comment out all ErrorDocument lines in httpd.conf (they were producing 404's). Thanks anyway :D

the-chains 12-17-2004 05:52 AM

Are you sure there is a nagios process?
or else start it
ie:
./nagios -d ../etc/nagios.cfg

and read the documentation as for authentication
ifor example, if you want to do host checks, you need to make sure you are in one of the contact and contactgroup...

There's a lot to Nagios

dwarf007 01-04-2005 08:06 PM

Thanks for all of you guys reply :)

I setup the web server (httpd) in both Fedora Core 2 and Red Hat 9. I found out it doesnt work in
Fedora Core 2, even with the same nagios config for httpd.conf.

I am still not sure with this yet. Any of you guys experience with the same problem as well?

I had tried in Red Hat 9 and it works only (Ping) host currently. Any of you have a good reference for the confiiguration? Other than (Check Host Alive, Ping), what are the good features in Nagios to be use?

Thank You.....

david_ross 01-05-2005 03:16 PM

Are you using SELinux in FC2?

dwarf007 01-07-2005 04:15 AM

how to check whethere is SELinux? I only know i am using FC2 :)

What are the best part of nagios? So far i am only know the use of Ping host alive.

Any of you know the other part of nagios?

Jamesk5 02-17-2005 05:41 AM

I'm having a similar problem
On trying to access my local testing servers nagios installation (http://192.168.0.135/nagios) I get the following error:

Forbidden
You don't have permission to access /nagios/ on this server.


--------------------------------------------------------------------------------

Apache/2.0.49 (Fedora) Server at 192.168.0.135 Port 80

I have no .htaccess files as I took them out to try and rectify the problem.

My httpd.conf file looks like this:

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>

Ive restarted apache several times. Other dirs work, but they are located in /var/www/html/.... so it must just be the alias.
Im running fedora core 2 - which may be the cause of my problems!

dwarf007 02-19-2005 03:06 AM

I think u need to change the access permission for both

/usr/local/nagios/etc and /usr/local/nagios/sbin

change this permission to 777 or 755, i tried with 777 and is ok

I am configuring nagios in RedHat 9 and its work fine.

for Fedora Core 2 , i had tried before, there is some problem when you access the nagios page. It didnt works even i copy the my RedHat 9 httpd.conf (which includes script alias and alias for nagios) to Fedora Core 2

I hope this help you.....

Jamesk5 02-19-2005 05:56 AM

thanks, it didnt work - so it might just be FC2.
does anyone know if there are any problems with running nagios in FC3??
Or anyone got more suggestions for getting it running in FC2??

dwarf007 02-19-2005 08:29 AM

I think is better to stick with RedHat 9 , Fedora Core seems much more better to be use for Desktop purpose. I think RedHat 9 is more stable, if you need new packages, just upgrade :)

If you are going for Nagios, i suggest use RedHat 9 should be no issues.

Jamesk5 02-19-2005 08:34 AM

thanks for ur help!
I'll have to see if i can get my hands on a copy of RH9 (I havent got fast internet so downloading isnt an option).
In the mean time, any help will be appreciated!!!!!!

Jamesk5 03-20-2005 05:43 AM

i got a copy of fc3, and fixed my problem with not being able to access /naigos/
but i now get the following msg when trying to access the CGIs
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


--------------------------------------------------------------------------------

Apache/2.0.52 (Fedora) Server at 192.168.0.5 Port 80

Server Log:
[Sun Mar 20 21:16:02 2005] [error] [client 192.168.0.219] (13)Permission denied: exec of '/usr/local/nagios/sbin/tac.cgi' failed, referer: http://192.168.0.5/nagios/side.html
[Sun Mar 20 21:16:02 2005] [error] [client 192.168.0.219] Premature end of script headers: tac.cgi, referer: http://192.168.0.5/nagios/side.html


I've got the whole of the /usr/local/nagios dir set to permissions of 777 .. I'm stumped when it comes to looking for the source of this problem!

dwarf007 03-21-2005 05:07 AM

I had check with my "tag.cgi" file, we cant config the file cause cant open by vi.
This might be Apache server again.... I am not sure with is kernel or might be many thing else.

Jamesk5 03-22-2005 06:55 AM

Ok.. ive finally fixed the problem mentioned above. it ended up being somthing to do with selinux.
Now I'm faced with the following error when trying to access the cgi's!!

Whoops!
Error: Could not open CGI config file '/usr/local/nagios/etc/cgi.cfg' for reading!

Here are some things you should check in order to resolve this error:


Make sure you've installed a CGI config file in its proper location. See the error message about for details on where the CGI is expecting to find the configuration file. A sample CGI configuration file (named cgi.cfg) can be found in the sample-config/ subdirectory of the Nagios source code distribution.
Make sure the user your web server is running as has permission to read the CGI config file.

Make sure you read the documentation on installing and configuring Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org.




The file is there (because i can VI it) and the etc/ dir has permissions of 777.
Help anyone??

dwarf007 03-22-2005 08:38 AM

It seems that was the access of the nagios permission.

Do you manage to access the nagios monitoring site? Mine is http://NagiosServerIP/nagios/
What did you get after you access this site? Make sure you also start httpd service and nagios service.

If you got permission error, you can have a read on the documentation which stated how to create a nagios login user which access the URL.

the cgi.cfg is the main file to control your nagios other files. Make sure you configure your nagios proper when install it, that is the key to make it work cause the path pointing

Dont know answer your question or not? I dont really understand your situation......
I still have a lot of thing cant manage to configure in nagios, it is tough. Once done, it will be nice :)

Hope this help you....

Jamesk5 03-23-2005 01:57 AM

I can access http://nagiosIP/nagios/ fine - otherwise i wouldnt be getting the above error message.
As I unsderstand it, if you dont have the permissions (ie .htaccess) files set up and in the directory, you should be able to access the cgi files - I have been able to do that previously in my FC2 setup.
The cgi file has the right path:
Error: Could not open CGI config file '/usr/local/nagios/etc/cgi.cfg' for reading!
As i said, the file that is in that error message is there and it has 777 permissions.

I really have no idea whats the problem here, but thanks for your help!

dwarf007 03-23-2005 04:28 AM

I think this happen might be you accidently change some commands or add in invalid text in the cgi.cfg file. Then the file couldnt manage to run completely.

Since you can vi the file and with 777 permission, i think that is the only reason you cant run the file.
Maybe you should get back the original cgi.cfg file and reconfigure again.

Hope this help you...

Jamesk5 03-23-2005 05:50 AM

i just tried using the sample cgi.cfg (after renaming it to its right filename) and it didnt work!!!

omlex 02-13-2006 02:15 AM

nagios did not emit a sound alarm
 
Hi d!

I have problem with Nagios, I want it to send an alarm to my speaker everytime a host is down. Could you help me out with this problem?!

In my cgi.cfg I enabled:

host_unreachable_sound=hostdown.wav
service_critical_sound=hostdown.wav
....
....


And I have all these wavs in /usr/local/nagios/share/media/

BR

dwarf007 02-13-2006 07:03 AM

Sorry brother, I never use the sound notification before. I setup this at my previous company, I didnt use Nagios now.

henryJack85 06-07-2007 03:06 AM

About the ScriptAlias and Nagios
 
Hey, your error solve already?

May I know where should i put this code:

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

is read it some manual on this page (http://nagios.sourceforge.net/docs/1_0/installweb.html) said that add into the httpd.conf

Then the manual say /etc/rc.d/init.d/httpd restart.

Inside /etc/rc.d/init.d/ don't have the service call httpd.

So I yum install the httpd service.

I quite confuse here actually where is the httpd.conf file located?

I quite sure is edite the apache "httpd.conf".

Why have to restart the /etc/rc.d/init.d/httpd?

If don't have the httpd file i still can access the localhost....

I Don't know why?

Please clear it for me.

Best Regards
HenryJack

dwarf007 06-19-2007 11:50 PM

Is almost 1 1/2 year i didnt touch with nagios. haha..

If I am not mistaken, the below script should put in httpd.conf file
I remember there are 2 items to put in the file. There is a sequence to put it, you have to read on the documentation :)

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

Regarding where is the httpd.conf file locate. Just issue find command to check it.
After edit the httpd.conf file, you may need to restart apache and test again.

luis_fermoi 01-27-2009 05:50 PM

Nagios - You don't have permission to access /nagios/cgi-bin/ on this server.
 
Hello

How you resolve this problem? Can you help me?
Thanks...

Quote:

Originally Posted by dwarf007 (Post 1318260)
Thank You for the help.....

The problem is solved, but now i encounter another problem which is.

---------------------------------------------------------------------------
Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster

Error 403

linux-nagios
Sat 27 Nov 2004 06:42:03 PM MYT
Apache/2.0.40 (Red Hat Linux)
---------------------------------------------------------------------------

Can i know whats is the problem? The folder /usr/local/nagios/sbin originally only has cgi file inside and i had change all of them to 777 permission.

Anyone knows please help........
Thank You :)



All times are GMT -5. The time now is 11:13 AM.