Error cgi htpasswd.users

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
abe780
Posts: 3
Joined: Mon Mar 06, 2017 2:59 am

Error cgi htpasswd.users

Post by abe780 »

Hi everybody

I'm new in nagios and I have a problem with the authentication cgi's.

I have configured authentication with active directory in nagios xi.

When I created users using the menu "Manage Users" and I put the option Authentication Settings with the authentication type as active drectory till some days ago the file /usr/local/nagios/etc/htpasswd.users was updated correctly.

But the new users are not added as usual , I have to make it manually

htpasswd -s /usr/local/nagios/etc/htpasswd.users xxxxxxxxx

My config in nagios.conf is :

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Core"
AuthType Basic
AuthUserFile "/usr/local/nagios/etc/htpasswd.users"
Require valid-user
Require all denied
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Core"
AuthType Basic
AuthUserFile "/usr/local/nagios/etc/htpasswd.users"
Require valid-user
Require all denied
</Directory>

Do you have some idea about the problem ?

Thanks in advance
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error cgi htpasswd.users

Post by scottwilkerson »

This is because in nagios XI a different file is used:
/usr/local/nagiosxi/etc/htpasswd.users

Your config should look like this

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Core"
   AuthType Basic
   AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
   Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Core"
   AuthType Basic
   AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
   Require valid-user
</Directory>
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
abe780
Posts: 3
Joined: Mon Mar 06, 2017 2:59 am

Re: Error cgi htpasswd.users

Post by abe780 »

Hello

Thanks for the answer

I updated the file nagios.conf

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Core"
AuthType Basic
AuthUserFile "/usr/local/nagiosxi/etc/htpasswd.users"
Require valid-user
Require all denied
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Core"
AuthType Basic
AuthUserFile "/usr/local/nagiosxi/etc/htpasswd.users"
Require valid-user
Require all denied
</Directory>

I puted the file in the location indicated in the file but it's continue without adding the new users

thanks in advance
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error cgi htpasswd.users

Post by scottwilkerson »

You will need to restart httpd

Code: Select all

service httpd restart
Additionally, it will only add the users once the user logs into the Nagios XI UI and accepts the license. Then they will be added to /usr/local/nagiosxi/etc/htpasswd.users and able to login to the Core UI as well
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
abe780
Posts: 3
Joined: Mon Mar 06, 2017 2:59 am

Re: Error cgi htpasswd.users

Post by abe780 »

Hi

It works , You are right after accept the terms the user appears in the file htpasswd.users

Thank you very much
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error cgi htpasswd.users

Post by scottwilkerson »

abe780 wrote:Hi

It works , You are right after accept the terms the user appears in the file htpasswd.users

Thank you very much
Glad it is all working for you now.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked