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=''