Page 1 of 1

Adding new user in Nagios doesn't work

Posted: Tue Apr 29, 2014 5:33 am
by bzlom
Hi,

we are running Ubuntu 12.04.4 LTS with Nagios Core Version 3.2.3. It was configured by the previous administrator.
It had authentication enabled for a custom user - admin which has the full permissions to the Nagios web interface.

Now there is a need to add a new Read Only user for the development team. No problem - a ton of guides out there.

1. I have generated with "htpasswd" tool a new user/password in htpasswd.users called "developers"

2. I have modified the cgi.cfg to contain:
authorized_for_all_services=admin,developers
authorized_for_all_hosts=admin,developers

Restarted nagios3 service and apache2 service. Clean the browser cache completely, cookies and all that stuff.

When I'm trying to authenticate the first account (admin) works, the second one (developers) - doesn't.
Is there some other change that should be done, or what else should I check - maybe on the apache2 side?

Re: Adding new user in Nagios doesn't work

Posted: Tue Apr 29, 2014 10:52 am
by sreinhardt
What command did you use with htpasswd? Also are you certain that this is the same htpass file listed in the apache nagios configs?

Re: Adding new user in Nagios doesn't work

Posted: Wed Apr 30, 2014 3:18 am
by bzlom
The command was used to add the developers username/pass:
# htpasswd /etc/nagios3/htpasswd.users developers

here is the relevant content of /etc/nagios/apache2.conf

Code: Select all

<DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3|/etc/nagios3/stylesheets)>
        Options FollowSymLinks

        DirectoryIndex index.php index.html

        AllowOverride AuthConfig
        Order Allow,Deny
        Allow From All

        AuthType Digest
        AuthName "[N] Authentication Required"
        AuthDigestDomain /nagios3/
        AuthDigestNonceLifetime 86400
        AuthDigestProvider file
        AuthUserFile /etc/nagios3/htpasswd.users
        Require valid-user

        # nagios 1.x:
        #AuthUserFile /etc/nagios/htpasswd.users
</DirectoryMatch>

Re: Adding new user in Nagios doesn't work

Posted: Wed Apr 30, 2014 10:14 am
by bzlom
Also if that is of any help - I have reset the password for the old admin account, and restarted nagios3 service and apache2. Cleared browser cache.
Nagios doesn't accept the new password, nor the old one. Therefore I'm modifying the correct htpasswd.users file, but something doesn't work.

Re: Adding new user in Nagios doesn't work

Posted: Wed Apr 30, 2014 3:34 pm
by lmiltchev
Try resetting the htpasswd.users:

Code: Select all

htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin
Then try adding the "developers":

Code: Select all

htpasswd /etc/nagios3/htpasswd.users developers
Restart nagios and apache. Verify that you can see both users:

Code: Select all

cat /etc/nagios3/htpasswd.users
Try logging to the web interface.

Hope this helps.