首页 > 代码库 > 简单shell脚本(mongo)

简单shell脚本(mongo)

#

#监控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 fanyin@centaur.cn


简单shell脚本(mongo)