I'm having a spot of trouble with check_ldap.

my command is:

./check_ldap -H myhost.com -b o=ABC,c=D -p 1234

I'm getting the error:

"could not search/find object classes in o=ABC,c=D"

Any ideas what this means?

  • 2
    Does the regular ldapsearch work with that particular query? – Janne Pikkarainen Sep 9 '10 at 6:33
  • Thanks Janne, I'm running Fedora 12 - ldapsearch doesn't seem to be installed (however openldap is). I'm currently attempting to install it.... – chickeninabiscuit Sep 9 '10 at 7:54
  • God bless RPM hell. You've installed the common libraries (openldap-common) and the server process(es) (openldap-server), but not the command line utilities (openldap-client/openldap-utils). – VxJasonxV Sep 9 '10 at 23:20

Try to use in such way:

# /usr/lib/nagios/plugins/check_ldap -H ldap.some.com -b 'dc=company,dc=com' -D 'cn=my-user,ou=Company,dc=company,dc=com' -P Password -3
LDAP OK - 0.001 seconds response time|time=0.001166s;;;0.000000

The error message leads me to believe your baseDN. It is, quick clearly, saying that it could not find object in that baseDN. It could be a permissions issue with the username/password you're binding with (if relevant, given that it's missing from your example), or an actual baseDN issue. I'm leaning towards the latter.

Two thoughts;

(1) Janne ultimately is leading you in the correct direction. As we don't exactly know what your tree looks like, and your baseDN is (rightly) masked, it's very hard to provide more insight given the nature of LDAP. I would suggest plugging your query into ldapsearch and seeing what records are returned when searching the baseDN you've specified here.

(2) Port 1234? Seriously? Are you honestly running slapd on port 1234?

  • 2) nah - these ports and names are fictitious – chickeninabiscuit Sep 9 '10 at 7:55
  • 1) i'll see if i can find out what ldapsearch says - just need to install it on fedora12 first... thanks! – chickeninabiscuit Sep 9 '10 at 7:56

In my case, I had the same error as you. I just took off the "," and it worked...

[root@ldap1 plugins]# ./check_ldap -H host -b cn=config,c=D -p 1389  
Could not search/find objectclasses in cn=config,c=D
[root@ldap1 plugins]# 
[root@ldap1 plugins]# ./check_ldap -H host -b cn=config c=D -p 1389  
LDAP OK - 0.001 seconds response time|time=0.001234s;;;0.000000
[root@ldap1 plugins]# 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.