From 78a2800151b9c57aed50352bdd9f660b1dc0cf99 Mon Sep 17 00:00:00 2001 From: Gardais Jeremy Date: Fri, 27 Nov 2015 14:15:46 +0100 Subject: [PATCH] Add ldap1_connection to verify ESTABLISHED connections to ldap1.ipr --- ldap1_connection.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 ldap1_connection.sh diff --git a/ldap1_connection.sh b/ldap1_connection.sh new file mode 100755 index 0000000..3f4bfe1 --- /dev/null +++ b/ldap1_connection.sh @@ -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