Adding new user in Nagios doesn't work

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.
Locked
bzlom
Posts: 3
Joined: Tue Apr 29, 2014 5:23 am

Adding new user in Nagios doesn't work

Post 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?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Adding new user in Nagios doesn't work

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
bzlom
Posts: 3
Joined: Tue Apr 29, 2014 5:23 am

Re: Adding new user in Nagios doesn't work

Post 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>
bzlom
Posts: 3
Joined: Tue Apr 29, 2014 5:23 am

Re: Adding new user in Nagios doesn't work

Post 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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Adding new user in Nagios doesn't work

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked