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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

以上是关于SHELL脚本监控达梦数据库是否运行?的主要内容,如果未能解决你的问题,请参考以下文章