Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.04

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.
stewlg
Posts: 15
Joined: Fri Nov 14, 2014 11:03 am

Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.04

Post by stewlg »

I recently put a server through an unexpectedly traumatic Ubuntu apt-get dist-upgrade to 14.04, and one of the things affected was Apache and Nagios.

I've finally gotten it so I can see the Nagios screens again, but it's still not working correctly yet.

- I'm no longer prompted to log in, ever (I want to always log in as nagiosadmin)
- I see "Logged in as ?" under current network status
- When I try to do anything I get error messages such as "It appears as though you do not have permission to view information for any of the hosts you requested... If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI and check the authorization options in your CGI configuration file."
- I get no errors in Apache's log or Nagios's log

Looking at others with similar problems, I would assume I need to get Apache to oblige me to login. I've tried to cause this to happen a variety of ways, but I so far have not gotten it to work. For example here's my httpd.conf:

Code: Select all

ScriptAlias /nagios/cgi-bin /usr/lib/cgi-bin/nagios3
<Directory "/usr/lib/cgi-bin/nagios3">
    AllowOverride AuthConfig
    Options ExecCGI
    Require all granted
    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">
    Options None
    AllowOverride AuthConfig
    Require all granted
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /usr/local/nagios/etc/htpasswd.users
    require valid-user
</Directory>
(I've been running Nagios since 3, don't be thrown off by the directory name; I promise to fix it if I can get this working again.)

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

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Post by lmiltchev »

Can you run the following command and show us the output?

Code: Select all

grep nag /etc/group
Be sure to check out our Knowledgebase for helpful articles and solutions!
stewlg
Posts: 15
Joined: Fri Nov 14, 2014 11:03 am

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Post by stewlg »

Sure:

Code: Select all

root@griffin:/var/log/apache2# grep nag /etc/group
nagios:x:1003:
nagcmd:x:1004:nagios,www-data
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Post by abrist »

The user "nagios" should be in the groups "nagios" and "www-data".
The user "www-data" should be in the groups "nagios" and "www-data".
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
stewlg
Posts: 15
Joined: Fri Nov 14, 2014 11:03 am

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Post by stewlg »

Ok, this is how it looks now:

Code: Select all

root@griffin:~# grep nag /etc/group
www-data:x:33:nagios,www-data
nagios:x:1003:nagios,www-data
nagcmd:x:1004:nagios,www-data
My problem remains - no change.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Post by Box293 »

Is SELinux enabled?

getenforce

Also, run these commands:

Code: Select all

a2enmod rewrite
a2enmod cgi
service apache2 restart
Does this help?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
stewlg
Posts: 15
Joined: Fri Nov 14, 2014 11:03 am

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Post by stewlg »

Apparently I am not running selinux. I didn't need selinux before, hopefully I don't need it now.

Code: Select all

root@griffin:~# getenforce
Disabled
root@griffin:~# 
mod rewrite and cgi were already enabled:

Code: Select all

root@griffin:~# a2enmod rewrite
Module rewrite already enabled
root@griffin:~# a2enmod cgi
Module cgi already enabled
root@griffin:~# service apache2 restart
 * Restarting web server apache2
   ...done.
Still not working.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Post by Box293 »

Can you please attach your apache2.conf file, it's probably in /etc/apache2/
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
stewlg
Posts: 15
Joined: Fri Nov 14, 2014 11:03 am

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Post by stewlg »

Attached find my current apache2.conf.

I appreciate all the suggestions so far, and look forward to getting this working again.
Attachments
apache2.conf
apache2.conf
(7.41 KiB) Downloaded 217 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Post by Box293 »

Thanks for that.

Can you please do the following:

Code: Select all

ls -al /etc/apache2/conf-enabled/
ls -al /etc/apache2/sites-enabled/
I want to see what files are in the folders to compare them with the apache2.conf file.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked