上一主题: 创建批处理文件以启动 CA ControlMinder 服务下一主题: 配置辅助企业管理服务器


创建批处理文件以检查 CA ControlMinder 服务的状态

创建批处理文件,以便检查主要和辅助企业管理服务器上的全部 CA ControlMinder 服务的状态。

注意:基于您的需求,自定义脚本。 用于示例的退出代码是基于 Veritas 设置,有关代码的更多信息,请参阅 Symantec 支持网站

以下内容是检查全部 CA ControlMinder 服务状态的示例:

#!/bin/sh

a=1;
b=1;
c=1;
d=1;
#CA Control Minder Status check using the Process SEOSD status
ps -ef | grep -v grep| grep seosd >/dev/null 2>&1;
a=$?;

#JCS running status check
b=`/etc/init.d/im_jcs status`;
if [ "$b" == "jcs is running" ];
then
b=0;
else
b=1;
fi

#CA ControlMinder Message Queue status check
c=`/etc/init.d/ca-acrptmq status`
if [ "$c" = "CA ControlMinder Message Queue is running" ];
then
c=0;
else
c=1;
fi

#JBOSS running status check
ps -ef | grep -v grep| grep run.sh >/dev/null 2>&1;
d=$?

#echo "$a $b $c $d"  #To Check the Individual process Status All Zeros Means All Services are up and running and All Ones Means All Services are down

#Script status will return '110' when all the services are up and running, will return '100' when all services are down and will return '1' when anyone of the service is down
if [ "$a$b$c$d" = "0000" ];
then
exit 110

elif [ "$a$b$c$d" = "1111" ];
then
exit 100

else
exit 1
fi