Reputation: 23018
I have a slapd LDAP server which is critical to my application. I want to monitor it in order to detect when it has become over-loaded or if it fails.
Unfortunately we are stuck with a very old edition of slapd which has a known bug: It cannot cope with more than 64 concurrent connections. If a client attempts to open any more connections slapd blocks, causing all kinds of problems.
I have been asked to make a tool which will find the number of connections open at any given moment - this might be used in an automatic monitoring tool, but how can I find out the state of slapd? Is there a way to do it?
Upvotes: 1
Views: 11820
Reputation: 1894
You can use monitor backend for OpenLDAP to query ldapserver itself for number of connection it currently holds.
Upvotes: 0
Reputation: 14743
The best tool for that is lsof.
lsof -i tcp:389
will show you all TCP connections to your LDAP server.
Upvotes: 4
Reputation: 6539
Not directly slapd related but have you thought of using netstat to fetch the number of established connections?
Something like this could do it:
netstat -na | grep ESTABLISHED | grep -E "^tcp\s+[0-9]+\s+[0-9]+\s+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:3306" | wc -l
This one is for ubuntu linux - prints the number of connections to the mysql server. So you'd need to change the port number to 389 (or the port you use for slapd).
Upvotes: 2