DATE=`date +'%F %T'`
DES_servername=$1
URL=$2
# service status確認
#service_check=`curl --verbose $URL 2>&1 | grep "HTTP/1.1 200 OK" |awk '{print $3}'`
service_check=`curl --connect-timeout 5 --max-time 10 -o /dev/null -s -w %{http_code}"\n" "$URL"`
if [ "$service_check"x = "200"x ];then
echo -e "\033[32m$DATE $DES_servername Service online\033[0m"
else
echo -e "\033[31m$DATE $DES_servername Service offline\033[0m"
fi