1

I'm on centos, and I need to check that an AD server is running (is in another host). Which is the simplest way to check ldap (AD) is running? I have an application where I need to synchronize some users account with AD, but suddenly I'm getting 0 users found. I don't know much about AD and LDAP, I just tested with:

[root@mysystem]# ldapsearch -x
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

Is that enough to check that LDAP is down? Or can it be another reason?

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
pmiranda
  • 113
  • 1
  • 1
  • 5

1 Answers1

1

Can't contact LDAP server (-1) doesn't explicitly mean that your AD isn't "running".
There are few things that could cause that error.

  • Server being shutdown
  • Deamon stopped
  • and many more...

You might also have some misconfiguration, or something else blocking you to contact your AD.

However, if you can ldapsearch with some anonymous request (with -x) just before, I suppose that's an acceptable way to check.

If I refer myself to this previous post How to test a LDAP connection from a client, the test you're currently using should be fine. (considering it was working before, and it's a connectivity issue, and not a misconfiguration)

Make yourself sure that anonymous authentication are enable, and you can actually query the AD with it.

enter image description here

Tolsadus
  • 1,123
  • 11
  • 22
  • I did `[root@mysystem]# telnet 10.0.0.230 389 Trying 10.0.0.230... Connected to 10.0.0.230. Escape character is '^]'.` so that means that the server is up but, then? – pmiranda Feb 21 '18 at 15:33
  • Can you maybe check the config files of the server/user trying to access your AD ? Check also if they can actually query with anonymous auth. – Tolsadus Feb 21 '18 at 15:34
  • Hmm, I'll have to ask to the sysadmin of the LDAP server I think :/ as I said I was able to connect to LDAP just a few days ago and suddenly it stopped – pmiranda Feb 21 '18 at 17:51
  • Ok, all was fine, connection was ok, LDAP is up. I had some issues in my app config. All good now. – pmiranda Feb 21 '18 at 19:29
  • 1
    Awesome ! Have a good day :D – Tolsadus Feb 21 '18 at 19:29