SHELL脚本监控达梦数据库是否运行?

#!/bin/bash

status=`/etc/init.d/DmServiceDMSERVER status | grep running | wc -l`

process=`ps -ef | grep dmserver | grep -v grep | wc -l`

port=`lsof -i:5236 | grep -i listen | wc -l`

if
    [ $port -ne 0 ] && [ $process -ne 0 ] && [ $status -ne 0 ]

    then

        echo "dmserver is running"

    else

        echo "dmserver is not running"

fi
上一篇:MFC 中 CreateEx() 函数


下一篇:svn报错:[Previous operation has not finished; run 'cleanup' if it was interrupted] 的排错过程