Check LDAP avaibility regulary based from Linux

in some situation I had to check/validate if some services/protocol were still available from a remote machine.

Add this script into your crontab and schedule it as needed.

Review the IP

### IP Server LDAP
ldapsearch -x -h -b ” -p 389 -s base > /dev/null
# echo $?
if [ $? = “0” ]; then echo “$(date) – Connection OK” >> /tmp/ldap_con.log
else echo “$(date) – Connection NOT OK” >> /tmp/ldap_con.log

Leave a Reply