读书人

过程监控

发布时间: 2013-08-13 16:43:28 作者: rapoo

进程监控
*/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;

读书人网 >编程

热点推荐