I wonder if I could authenticate Nagios to LDAP, and if the answer is positive to this question. In what way could I do it?
Yes, you can. Authentication is handled by your web server so you will need to configure it there. I use LDAP authentication in Apache for my Nagios server. Here is how I have it configured:
<Directory "/usr/local/nagios/sbin">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
Require valid-user
AuthLDAPUrl ldap://ldapserver.example.com:3268/DC=example,DC=com?sAMAccountName?sub
AuthLDAPBindDN CN=binduser,OU=IT,DC=example,DC=com
AuthLDAPBindPassword bindpassword
AuthzLDAPAuthoritative off
AuthBasicProvider ldap
</Directory>
Note: you will need the same configuration for your /usr/local/nagios/share directory! Don't forget!
The last five directives are what are important. Make sure that Apache has the authnz_ldap module loaded and enabled otherwise you will get an error. The AuthLDAPUrl should be a URL for your LDAP server and what you want to check. I am using the sAMAccountName field in MS Active Directory. My LDAP server also requires that I bind to it with a valid user before I can make a query. I specify that user with the AuthLDAPBindDN and AuthLDAPBindPassword directives. Keep in mind that if you want to restrict Nagios logins to just a few users, you can use the Require directive to list the approved users such as:
Require user1 user2 user3
...and so forth.
I'm not an LDAP expert so I can't really advise you on how to change the LDAP string, but I hope this will help you enough to make it work.
If you mean authenticate Nagios users trough LDAP then click here.
精彩评论