On Thu, 19 Dec 2013 17:15:31 +0100 (CET) Christian Kratzer <ck-lists(a)cksoft.de>
On Thu, 19 Dec 2013, Michael Ströder wrote:
> Using back-mdb there's one thing which could cause trouble:
> One has to configure olcDbMaxSize which cannot be changed later.
> So when monitoring OpenLDAP with back-mdb it would be interesting to see
> how much space of configured olcDbMaxSize is already occupied.
> Does it make sense to compare the real file size shown by du -h
> /path/to/data.mdb to configured olcDbMaxSize?
something like mdb_stat:
[ldaptest1]# mdb_stat -e /var/lib/ldap
Map address: (nil)
Map size: 1073741824
Page size: 4096
Max pages: 262144
Number of pages used: 2604
Last transaction ID: 125386
Max readers: 126
Number of readers used: 9
Status of Main DB
Tree depth: 1
Branch pages: 0
Leaf pages: 1
Overflow pages: 0
Although I am not 100% sure what would be the best values to monitor.
Propably Number of pages used and max pages.
Hmm, I'd prefer to use pure Python and avoid calling external command-line
How about plain file status information like described here? After all I'm just
interested in a percentage of the used space.
There's a hard-coded block-size of 512 bytes used therein which seems to match
output of command "du -h" on my system. Not sure about other systems though.