Page 1 of 1

Unable to import users from LDAP

Posted: Wed Dec 28, 2016 10:40 am
by RichardPopleVM
Hi support - I'm unable to import LDAP users to NagiosXI - no users show up, screenshot attached.

nagios version: Nagios XI 5.3.4
Linux Distribution and version? CentOS Linux release 7.3.1611 (Core)
32 or 64bit? x86_64
VMware Image or Manual Install of XI? Manual
ldap version: OpenLDAP: slapd 2.4.40

Nothing gets added to:
/var/log/httpd/*error_log
during the attempt to import users.

I don't think it's a network issue as I get a successful response from
ldapsearch -h 10.176.134.65 xxxxxxxxxxxxxxxx
from the cli on the server hosting NagiosXI.

Please advise.

Thanks

Richard

Re: Unable to import users from LDAP

Posted: Wed Dec 28, 2016 1:10 pm
by ssax
Run this command to enable debugging:

Code: Select all

sed -i 's/\/\/ Otherwise check authentication/ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);/g' /usr/local/nagiosxi/html/includes/components/ldap_ad_integration/ldap_ad_integration.inc.php
Then run this tail command, replicate the blank screen, and then send me the entire output from the tail command:

Code: Select all

tail -f /var/log/httpd/*error_log

After you've done that, run this command:

Code: Select all

sed -i 's/ldap_read($this->ldapConnection, NULL/ldap_read($this->ldapConnection, ""/g' /usr/local/nagiosxi/html/includes/components/ldap_ad_integration/basicLDAP.php

Then run this tail command, replicate the blank screen, and then send me the entire output from the tail command:

Code: Select all

tail -f /var/log/httpd/*error_log

When you are done, revert the changes with these commands:

Code: Select all

sed -i 's/ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);/\/\/ Otherwise check authentication/g' /usr/local/nagiosxi/html/includes/components/ldap_ad_integration/ldap_ad_integration.inc.php
sed -i 's/ldap_read($this->ldapConnection, ""/ldap_read($this->ldapConnection, NULL/g' /usr/local/nagiosxi/html/includes/components/ldap_ad_integration/basicLDAP.php

Re: Unable to import users from LDAP

Posted: Thu Dec 29, 2016 5:14 am
by RichardPopleVM
Requested output attached.

Re: Unable to import users from LDAP

Posted: Thu Dec 29, 2016 11:50 am
by dwhitfield
Are there any special characters in your users? If so, what are the characters?

Re: Unable to import users from LDAP

Posted: Thu Dec 29, 2016 12:02 pm
by RichardPopleVM
No - userids are just alpha/numeric combinations.

Re: Unable to import users from LDAP

Posted: Thu Dec 29, 2016 1:32 pm
by ssax
Try editing this file:

Code: Select all

/usr/local/nagiosxi/html/includes/components/ldap_ad_integration/basicLDAP.php
Around line 74, cange this code:

Code: Select all

        if ($ret) {
            $this->baseDn = $this->findBaseDn();
        }
To this:

Code: Select all

//        if ($ret) {
//            $this->baseDn = $this->findBaseDn();
//        }
Then test it again and see if it's working now.

If it's still not working, please run this command again (only if you reverted) and then try again:

Code: Select all

sed -i 's/ldap_read($this->ldapConnection, NULL/ldap_read($this->ldapConnection, ""/g' /usr/local/nagiosxi/html/includes/components/ldap_ad_integration/basicLDAP.php

Thank you

Re: Unable to import users from LDAP

Posted: Fri Dec 30, 2016 6:12 am
by RichardPopleVM
I did both of those and still the same ie 'No users or computers found in this object.'

I re-did the previous debug line and attached another error log tail in case it's any different.

Re: Unable to import users from LDAP

Posted: Fri Dec 30, 2016 2:09 pm
by ssax
Let's move this into a ticket, please email [email protected] with a descriptive subject and detailed body and please include a link back to this thread so that we can get a remote session setup.

Thank you

Re: Unable to import users from LDAP

Posted: Tue Jan 03, 2017 6:27 am
by RichardPopleVM
Done.

Re: Unable to import users from LDAP

Posted: Tue Jan 03, 2017 10:07 am
by ssax
Locking the topic as we've received your support ticket, we will continue support through the ticket.

Thank you