Daily Archives: 16 August 2013

LDAP Connections and NETSTAT

A couple of months back we had a problem with an application that we had taken on the maintenance of. Before it crashed in an undignified manner, it was hammering the LDAP server and hogging all of the available LDAP connections. Now, I’m not going to go into the fix for that problem, but I would like to chronicle here the netstat command that we would run to check out the LDAP connections.

netstat has been around for ages and is on old DOS thing. It can give you some information about the TCP/IP data of the network traffic on your system and its ports.

The LDAP protocol is normally listened for on port 389. So, to count the current number of LDAP connections to an LDAP server, you can run:
D:\netstat -an | find /c ":389"
The -an flags make it display all connections and listening ports, in numerical form.
Piping it to find effectively filters the results and /c performs a count.

That is all. Have a nice weekend. Don’t kick any dogs.