Page 1 of 2

Nagiosmobile passwords

Posted: Thu Sep 08, 2016 8:22 am
by BanditBBS
So, where is nagiosmobile getting the authentication from? I login to nagiosmobile with my original password for XI. We have since changed to AD authentication and I'd love for nagiosmobile to use those same credentials, is that not possible?

Re: Nagiosmobile passwords

Posted: Thu Sep 08, 2016 8:42 am
by eloyd

Code: Select all

# cat /etc/httpd/conf.d/nagiosmobile.conf
#modify this file to fit your apache configuration

Alias /nagiosmobile "/usr/local/nagiosmobile"

<Directory "/usr/local/nagiosmobile">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all

#  Allow from 127.0.0.1

######use the below lines for Nagios XI
 # AuthName "Nagios Monitor XI"
 #  AuthType Basic
 # AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users


######Use the below lines for a SOURCE install of Nagios Core
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users


   Require valid-user
</Directory>

Re: Nagiosmobile passwords

Posted: Thu Sep 08, 2016 9:11 am
by BanditBBS

Code: Select all

#modify this file to fit your apache configuration

Alias /nagiosmobile "/usr/local/nagiosmobile"

<Directory "/usr/local/nagiosmobile">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all

#  Allow from 127.0.0.1

######use the below lines for Nagios XI
   AuthName "Nagios Monitor XI"
   AuthType Basic
   AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users


######Use the below lines for a SOURCE install of Nagios Core
#  AuthName "Nagios Access"
#  AuthType Basic
#  AuthUserFile /usr/local/nagios/etc/htpasswd.users


   Require valid-user
</Directory>
Mine looks about the same, but different section remarked out. So the question is, how is that htpasswd file being updated and can I get it to use the passwords people auth with to XI

Re: Nagiosmobile passwords

Posted: Thu Sep 08, 2016 9:28 am
by eloyd
That file was updated ~23 hours ago on our test XI system. I assume that there's some thing in XI that populates the file when "apply changes" are made.

Re: Nagiosmobile passwords

Posted: Thu Sep 08, 2016 10:22 am
by lmiltchev
All of the users in "htpasswd.users" should be able to log in nagiosmobile via basic auth.

Code: Select all

awk -F ':' '{print $1}' /usr/local/nagiosxi/etc/htpasswd.users

Re: Nagiosmobile passwords

Posted: Thu Sep 08, 2016 10:25 am
by BanditBBS
lmiltchev wrote:All of the users in "htpasswd.users" should be able to log in nagiosmobile via basic auth.

Code: Select all

awk -F ':' '{print $1}' /usr/local/nagiosxi/etc/htpasswd.users
So what password would that use? What happens for users we import from AD?

Re: Nagiosmobile passwords

Posted: Thu Sep 08, 2016 11:31 am
by ssax
The htpasswd file is updated with whatever password is used to login EVERY time the user logs in. When you initially import or create the user the htpasswd entry is only put into the htpasswd file on the first login and then will be updated on every successful login thereafter.

So it should use the AD password as long as they logged into the XI interface with that AD password before.

Re: Nagiosmobile passwords

Posted: Thu Sep 08, 2016 11:34 am
by eloyd
Aw, sweet! That actually helps me with a customer issue! :-)

Re: Nagiosmobile passwords

Posted: Thu Sep 08, 2016 11:43 am
by lmiltchev
BanditBBS, can we lock this topic?

Re: Nagiosmobile passwords

Posted: Thu Sep 08, 2016 12:49 pm
by BanditBBS
Ludmil, so shouldn't the file have a date/time equal to the last time someone logged into XI?

Code: Select all

-rw-r--r-- 1 nagios apache 4970 Aug 15  2015 /usr/local/nagiosxi/etc/htpasswd.users