检查系统状态的一段shell脚本

检查系统状态的一段shell脚本

保存下来供以后参考

 

#!/usr/bin/bash

#This script is used to send the SMS to a mobile when anyone of  apps stauts is problem.
#Autho Hu Dennis
#Date: March 14th, 2010

#get the status of each app
NBG_STATUS=`clt --status --det`

NBG_PROBLEM=`echo $NBG_STATUS|grep PROBLEM`

if [ -z $NBG_PROBLEM ] ; then
        echo '$NBG_PROBLEM is NULL.'

else
        echo $NBG_PROBLEM

# send sms to mobile
fi

你可能感兴趣的:(shell,脚本,mobile,each,sms,2010)