i dunno

Openldap Monitor With Cn=config

I needed to configure OpenLDAP running on Ubuntu 12.04 in such a way that query statistics could be monitored in Cacti. The documentation for OpenLDAP is usually quite thorough and can sometimes be overwhelming for newcomers. As it relates to the monitor module however, the documentation is actually non-existent (or at least isn’t readily available in that particular part of the documentation). Based on the pain felt in this thread and the lack of straight-forward documentation on this specific topic elsewhere, here we go:

Required LDIF

Add them to LDAP

# ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f add_monitor.ldif
# ldapadd -Q -Y EXTERNAL -H ldapi:/// -f configure_monitor.ldif

Test it

$ perl openldap_operations.pl -h ldap01 -D 'uid=cacti,ou=People,dc=foo,dc=bar,dc=com' -W 'foo'
bind-initiated:3929 bind-completed:3929 unbind-initiated:2511 unbind-completed:2511 search-initiated:4700 search-completed:4699 compare-initiated:0 compare-completed:0 modify-initiated:4 modify-completed:4 modrdn-initiated:0 modrdn-completed:0 add-initiated:21 add-completed:21 delete-initiated:8 delete-completed:8 abandon-initiated:0 abandon-completed:0 extended-initiated:2208 extended-completed:2208

The Cacti plugin can be found here.