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'
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
Am Wed, 25 Apr 2012 19:56:46 +0000 schrieb Bhargav Mistry bhargav.mistry@amdocs.com:
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'
any help is highly appreciated.
would this answer your question?
ldapsearch -x -H ldap://localhost -b "" -s base namingContexts configContext
-Dieter
Bhargav Mistry wrote:
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 ?
With OpenLDAP I'd look at the following attributes in the rootDSE and sort out things that way:
configContext: cn=config monitorContext: cn=Monitor namingContexts: cn=accesslog namingContexts: dc=stroeder,dc=de
Another option is to search under cn=Databases,cn=Monitor with filter (monitoredInfo=bdb) reading attribute 'namingContexts' provided back-monitor is configured.
Your mileage may vary...
Ciao, Michael.
Thanks Michael.
Following command line query gives me all the DNs from the files and I am able to parse them and use it as needed.
ldapsearch -x -b "cn=config" -H ldap://myserver-1:389 -D "cn=config" -w 'secret' -s 'sub' RootDSE
Thanks.
-----Original Message----- From: Michael Ströder [mailto:michael@stroeder.com] Sent: Wednesday, April 25, 2012 1:25 PM To: Bhargav Mistry Cc: openldap-technical@openldap.org Subject: Re: How to query ldap root DNs ?
Bhargav Mistry wrote:
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 ?
With OpenLDAP I'd look at the following attributes in the rootDSE and sort out things that way:
configContext: cn=config monitorContext: cn=Monitor namingContexts: cn=accesslog namingContexts: dc=stroeder,dc=de
Another option is to search under cn=Databases,cn=Monitor with filter (monitoredInfo=bdb) reading attribute 'namingContexts' provided back-monitor is configured.
Your mileage may vary...
Ciao, Michael.
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
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
openldap-technical@openldap.org