From e5a0dbfe8006d5afa7a5913d45a4f171c9fd2450 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 7 Feb 2019 13:57:49 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 9369983e..cbd34263 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -53,6 +53,17 @@ STATUS() { lip=$(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}${idsCL[LightCyan]} - localhost${idsCL[Default]}" DIVIDER false green + ping -c 3 $SERVERIP > /dev/null 2>&1 + if [ $? -ne 0 ] + then + # Use your favorite mailer here: + mailx -s "Server $SERVERIP is down" -t "$NOTIFYEMAIL" < /dev/null + fiping -c 3 $SERVERIP > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # Use your favorite mailer here: + mailx -s "Server $SERVERIP is down" -t "$NOTIFYEMAIL" < /dev/null +fi for srvc in "${LOCAL_SERVICES[@]}" do c=0; cw=22; spc=''