`

进程监控

 
阅读更多
*/10 * * * * sh /opt/fetch/mintor/process_mintor.sh >> /opt/fetch/mintor/process_mintor.log 2 >&1

#!/usr/sh

date=`date`
echo "start : $date"
array="aircoeer aircoder"

for name in $array;
do
echo '\n -----------\n'
echo $name
pid=`ps aux | grep  $name | grep -v grep | awk '{if (NR == 1) {print $2}}'`

echo "$pid"|grep -E '[0-9]+'
if [ $? -eq 0 ];then
echo "exist"
else
echo "not exist"
curl -q http://xx.13.81.10:10001/sms?appId=1001\&to=186xx\&msg=xxxx$name
fi

done;
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics