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?
Adding new user in Nagios doesn't work
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Adding new user in Nagios doesn't work
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.
Re: Adding new user in Nagios doesn't work
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
# 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
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.
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
Try resetting the htpasswd.users:
Then try adding the "developers":
Restart nagios and apache. Verify that you can see both users:
Try logging to the web interface.
Hope this helps.
Code: Select all
htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin
Code: Select all
htpasswd /etc/nagios3/htpasswd.users developers
Code: Select all
cat /etc/nagios3/htpasswd.users
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!