getLock()
{
if[-f"$Mon_Path/$Service_Name.lock"];then
return1
else
return0
fi
}
#writerthemessagetolog--------------------------
logwriter()
{
if[!-d`dirname$Mon_log`];then
mkdir-p`dirname$Mon_log`
fi
echo`date"+%Y-%m-%d%H:%M:%S"`:$1>>$Mon_log
}
#senderrorsmstoadmin---------------------
sendSmsToAdmin()
{
CurTime=`date"+%Y-%m-%d%H:%M:%S"`
if[$#-eq1];then
if[!-z"$1"];then
tmpTime=`date"+%Y%m%d%H%M%S"`
formobilein`cat$Admin_Mobile`
do
$SMS_Send-h$SMS_Server$mobile"$SMS_Header$1notupdate-$tmpTime-$SMS_From"
done
fi
else
logwriter"callsendSmsToAdminarguserror"
fi
}