2015-11-27 14:15:46 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Script to check if LDAP connections are initialized
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# List LDAP connections without:
|
|
|
|
# LISTEN
|
|
|
|
# 129.20.123.1 server
|
2015-11-30 10:11:44 +01:00
|
|
|
ss_cmd=$(ss -laputen | grep ":389 " | grep -v 129.20.123.1 | grep -v LISTEN)
|
2015-11-27 14:15:46 +01:00
|
|
|
|
|
|
|
# email recipient
|
|
|
|
mail_recip="jeremy.gardais@univ-rennes1.fr"
|
|
|
|
|
|
|
|
if [ "${ss_cmd}" ]; then
|
2015-11-30 10:11:44 +01:00
|
|
|
ss -laputen | grep ":389 " | grep -v 129.20.123.1 | grep -v LISTEN | mail -s "LDAP1 connections" "${mail_recip}"
|
2015-11-27 14:15:46 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|