[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: How to query ldap root DNs ?

Bhargav Mistry wrote:
> Hi,
> I have written a java tool which configures ldap servers for master
> master replication and proxy push.
> I need to query the root DNs for config and bdb databases so that I
> can use it in the tool but I am not sure how to query it ?
> I want to query the dn from the file olcDatabase={2}bdb.ldif but I
> don't know how?
> olcDatabase={2}bdb.ldif
> dn: olcDatabase={2}bdb
> objectClass: olcDatabaseConfig
> objectClass: olcBdbConfig
> olcDatabase: {2}bdb
> olcSuffix: dc=my-domain,dc=com
> olcAddContentAcl: FALSE
> olcLastMod: TRUE
> olcMaxDerefDepth: 15
> olcReadOnly: FALSE
> olcRootDN: cn=Manager,dc=my-domain,dc=com
> olcSyncUseSubentry: FALSE
> I tried using the following command line search query but it doesn't
> return any results:
> ldapsearch -x -b "" -s base "objectClass=olcBdbConfig" -H
> ldap://myserver-1:389 -D "cn=config" -w 'secret'
because your base is wrong. To dump all databases configurations, use:

# ldapsearch -LLLY external -H ldapi:/// -b "cn=config" -s sub -M 
'objectclass=olcDatabaseConfig'  2>/dev/null

To dump only the informations you may interested in:
# ldapsearch -LLLY external -H ldapi:/// -b "cn=config" -s sub -M 
'(&(objectclass=olcDatabaseConfig)(olcSuffix=*))' olcDatabase 
olcDbDirectory olcDbDirectory olcSuffix  2>/dev/null

dn: olcDatabase={1}hdb,cn=config
olcDatabase: {1}hdb
olcDbDirectory: /var/lib/ldap
olcSuffix: dc=example,dc=com

Never rely on the ordering numbers in dn and olcDatabase. They may 
change if one add monitor, accesslog or  othher statements to cn=config.

> any help is highly appreciated.
> Thanks.
> This message and the information contained herein is proprietary and
> confidential and subject to the Amdocs policy statement, you may
> review at http://www.amdocs.com/email_disclaimer.asp


Harry Jede