进程状态检查脚本

Posted by wukaiqiang; tagged with none

#!/bin/bash
for i in {ora_smon_orcl,ora_pmon_orcl};do 
  status=`ps -ef | grep smon | grep -v grep|wc -l`
  if [ $status -ne 0 ];then
     echo -e "$i is\033[32m running \033[0m"
  else 
     echo -e "$i is\033[31m not running \033[0m"
  fi
done