Previous Topic: Create Batch File to Start CA ControlMinder ServicesNext Topic: Configure the Secondary Enterprise Management Server


Create Batch File to Check Status of CA ControlMinder Services

Create a batch file to check the status for all CA ControlMinder Services on the Primary and Secondary Enterprise Management Servers.

Note: Customize the script based on your requirement. The exit codes that are used in the example are based on the Veritas setup, for more information about the codes, refer the Symantec Support website.

The following is an example to check the status for all CA ControlMinder Services:

#!/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