#
#监控mongodb进程
#
#author:fanyin
#
#
COMMAND=$(ps -ef|grep mongod |awk ‘{print $8}‘|awk ‘/mongod/{print $1}‘)
#echo $COMMAND
#echo ${#COMMAND}
function check(){
if [ ‘/data/mongodb/bin/mongod‘ = ${COMMAND} ]
then
echo "mongo is dead " |mail -s $1 $2
else
echo ‘dead‘
fi
}
check test [email protected]
时间: 2024-10-10 14:05:28