Page 1 of 1

LDAP Authentification on Nagios 4

Posted: Thu Feb 21, 2019 10:49 am
by cocoyanouck
Hi,

I want to implement LDAP authentification on my Nagios 4.4.3 (Debian 9).
The goal is to connect with our windows account on the web interface instead of "nagiosadmin"

I tried to read several articles but I'm really lost ...

https://support.nagios.com/kb/article/a ... n-600.html
http://www.localhostrich.com/en/apache- ... gios-ldap/
https://blog.pythian.com/nagios-authent ... directory/
https://support.nagios.com/forum/viewto ... 16#p253463
https://itefix.net/content/nagios-authe ... -directory
https://access.redhat.com/documentation ... figuration

Could you help me to do this, step by step please ?

Thanks a lot.

Re: LDAP Authentification on Nagios 4

Posted: Mon Feb 25, 2019 9:44 am
by ssax
Very strange, having trouble getting it working on my end as well. I'll let you know what I find.

Re: LDAP Authentification on Nagios 4

Posted: Mon Feb 25, 2019 10:40 am
by ssax
Here is what worked for me:

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# 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
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
         AuthBasicProvider ldap
         AuthType Basic
         AuthName "Nagios Access"
         AuthLDAPURL "ldap://192.168.X.X:3268/dc=contoso,dc=local?sAMAccountName?sub" NONE
         AuthLDAPBindDN "CN=Your User,CN=Users,DC=contoso,DC=local"
         AuthLDAPBindPassword "Pass"
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user
   </IfVersion>
</Directory>

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

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
         AuthBasicProvider ldap
         AuthType Basic
         AuthName "Nagios Access"
         AuthLDAPURL "ldap://192.168.X.X:3268/dc=contoso,dc=local?sAMAccountName?sub" NONE
         AuthLDAPBindDN "CN=Your User,CN=Users,DC=contoso,DC=local"
         AuthLDAPBindPassword "Pass"
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user
   </IfVersion>
</Directory>

Re: LDAP Authentification on Nagios 4

Posted: Mon Mar 11, 2019 9:38 am
by cocoyanouck
Hi,

Great, it's working fine, thank you so much.

You can close this ticket :)

Re: LDAP Authentification on Nagios 4

Posted: Mon Mar 11, 2019 2:52 pm
by ssax
That's great to hear, thanks for the update! Locking the thread.