#! /bin/bash
TEMP=$(sensors | grep "id 0" | cut -d + -f2 | cut -d . -f1)
if [ "$TEMP" -ge 40 ]; then
echo $TEMP
date > /tmp/temp
sensors >> /tmp/temp
TEMP_BODY="
Hello Helpdesk Team,
This is the Temperature Alert Message for ABC Server at DC Location,CITY:
$(cat /tmp/temp)
Regards,
Datacenter TEAM
"
echo "Subject: ALERT High Temperature for Server at DC Location " "$TEMP_BODY" | /opt/postfix-2.10.3.2z/sbin/sendmail -t email@domain.com
fi
TEMP=$(sensors | grep "id 0" | cut -d + -f2 | cut -d . -f1)
if [ "$TEMP" -ge 40 ]; then
echo $TEMP
date > /tmp/temp
sensors >> /tmp/temp
TEMP_BODY="
Hello Helpdesk Team,
This is the Temperature Alert Message for ABC Server at DC Location,CITY:
$(cat /tmp/temp)
Regards,
Datacenter TEAM
"
echo "Subject: ALERT High Temperature for Server at DC Location " "$TEMP_BODY" | /opt/postfix-2.10.3.2z/sbin/sendmail -t email@domain.com
fi
Comments
Post a Comment