Add ldap1_connection to verify ESTABLISHED connections to ldap1.ipr

This commit is contained in:
Jeremy Gardais 2015-11-27 14:15:46 +01:00 committed by Gardais Jérémy
parent 420755f00b
commit 78a2800151
1 changed files with 19 additions and 0 deletions

19
ldap1_connection.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
# Script to check if LDAP connections are initialized
# List LDAP connections without:
# LISTEN
# 129.20.123.1 server
ss_cmd=$(ss -laputen | grep 389 | grep -v 129.20.123.1 | grep -v LISTEN)
# email recipient
mail_recip="jeremy.gardais@univ-rennes1.fr"
if [ "${ss_cmd}" ]; then
ss -laputen | grep 389 | grep -v 129.20.123.1 | grep -v LISTEN | mail -s "LDAP1 connections" "${mail_recip}"
fi
exit 0