Unauthorized login in nagios 4.0.8

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
rafaelbraga
Posts: 8
Joined: Thu Sep 18, 2014 12:14 pm

Unauthorized login in nagios 4.0.8

Post by rafaelbraga »

Hi folks,

I installed the nagios 4.0.8 in my ubuntu 10.04 flowing all step that have in this tutorial:
http://assets.nagios.com/downloads/nagi ... Source.pdf

But when I will login in the web interface always appears this mensage:

Unauthorized

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

What may be happening? I hope your help!

Thanks!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Unauthorized login in nagios 4.0.8

Post by slansing »

Are you logging in as the nagiosadmin account? Or did you add an additional account? You need to make sure your use whatever you set up with htpasswd:

Code: Select all

htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin
rafaelbraga
Posts: 8
Joined: Thu Sep 18, 2014 12:14 pm

Re: Unauthorized login in nagios 4.0.8

Post by rafaelbraga »

I using the nagiosadmin account and doesn't include another user.
I've changed the password of the nagiosadmin many times. And don't work. :/
I suspect that the problem can be in the permission of the files in the Apache.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Unauthorized login in nagios 4.0.8

Post by tmcdonald »

What version of apache are you running?

Does anything appear in your apache logs?
Former Nagios employee
rafaelbraga
Posts: 8
Joined: Thu Sep 18, 2014 12:14 pm

Re: Unauthorized login in nagios 4.0.8

Post by rafaelbraga »

Version: 2.4.7-1ubuntu4.1

In the five last request of login have:

127.0.0.1 - - [19/Sep/2014:16:25:17 -0300] "GET /nagios HTTP/1.1" 401 691 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36"
127.0.0.1 - nagiosadmin [19/Sep/2014:16:25:24 -0300] "GET /nagios HTTP/1.1" 401 644 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36"
127.0.0.1 - - [19/Sep/2014:16:25:32 -0300] "GET /nagios HTTP/1.1" 401 691 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36"
127.0.0.1 - nagiosadmin [19/Sep/2014:16:25:39 -0300] "GET /nagios HTTP/1.1" 401 644 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36"
127.0.0.1 - - [19/Sep/2014:16:25:41 -0300] "GET /favicon.ico HTTP/1.1" 404 468 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36"
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unauthorized login in nagios 4.0.8

Post by lmiltchev »

Can you show us the nagios.conf file? I believe on Ubuntu the file should be located in "/etc/apache2/conf.d/" directory.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rafaelbraga
Posts: 8
Joined: Thu Sep 18, 2014 12:14 pm

Re: Unauthorized login in nagios 4.0.8

Post by rafaelbraga »

Hi,

Follows the contents of the file:

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unauthorized login in nagios 4.0.8

Post by lmiltchev »

This looks correct. Run one more time:

Code: Select all

htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin
and set a simple password (no special chars). Restart apache:

Code: Select all

service apache2 retart
Make sure selinux is disabled:

Code: Select all

setenforce 0
Stop iptables:

Code: Select all

service iptables stop
Try to log in the web UI:

Code: Select all

http://<ip address>/nagios
BTW, what do you see if you only type the ip in the browsers address bar?

Code: Select all

http://<ip address>
Be sure to check out our Knowledgebase for helpful articles and solutions!
rafaelbraga
Posts: 8
Joined: Thu Sep 18, 2014 12:14 pm

Re: Unauthorized login in nagios 4.0.8

Post by rafaelbraga »

Hi!

Doesn't worked... :/

When I put only my address IP in the browser shows the first page of the RoundCube that is configured in my machine...

Any ideia?

Thanks!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unauthorized login in nagios 4.0.8

Post by lmiltchev »

I will try to recreate the issue in house and will get back to you sometime today.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked