2

I am running OpenLDAP's slapd on Fedora 14, and I see that in the directory for the database, there is a log.0000000001 file. I would like to be able to read this file, as I am interested in recent transactions that have occurred. How do I read this file?

John
  • 21
  • 1
  • 2

2 Answers2

5

For the common Berkeley DB, db4-utils package including some tools to manipulate:

db_archive
db_checkpoint
db_deadlock
db_dump
db_dump185
db_load
db_printlog
db_recover
db_stat
db_upgrade
db_verify

But if you use db_printlog to read the Berkeley log files from OpenLDAP, you will get the below errors:

db_printlog: Program version 4.3 doesn't match environment version db_printlog: DB_ENV->open: DB_VERSION_MISMATCH: Database environment version mismatch

The reason is OpenLDAP shipped with internal copy tools of db-4.3:

slapd_db_archive
slapd_db_checkpoint
slapd_db_deadlock
slapd_db_dump
slapd_db_hotbackup
slapd_db_load
slapd_db_printlog
slapd_db_recover
slapd_db_stat
slapd_db_upgrade
slapd_db_verify

So, try this:

slapd_db_printlog -h /var/lib/ldap/ | less
quanta
  • 50,327
  • 19
  • 152
  • 213
1

Not sure how to read that file, but you can look a "recently" created or modified entries with
ldapsearch "(|(createTimestamp>=20110927221035Z)(modifyTimestamp>=20110927221035Z))" dn creatorsName createTimestamp modifiersName modifyTimestamp

OpenLDAP can use syslog facilities to log many things. Don't know if (or with what verbosity) Fedora 14 does this by default (or under your environment). (You probably checked for this already so likely not sufficient.)

A closer answer to your question as asked could be found at http://www.openldap.org/faq/data/cache/738.html before the links went stale. Though it all seems to lead to Oracle documentation, which is unsurprising.

84104
  • 12,698
  • 6
  • 43
  • 75