Script for monitoring status of GiCAP groups and group managers

3
# 1. Check the GiCAP_db status.
# 2. Confirm if negative sharing rights symptom is occurring.
# 3. Confirm if this script is launched from either AGM or SGM.
# 4. [On AGM]
# (a) Check the communication from AGM to SGM.
# (b) Check the occurrence of Split GiCAP group.
# (c) Check the communication from AGM to member OA(s).
# (d) Check if GiCAP_db transfer works correctly.
# [On SGM]
# (a) Check the communication from SGM to AGM.
# (b) Check the occurrence of Split GiCAP group.
#############################################################
check_GM_status()
{
#
# 1. Check the GiCAP_db status.
#
/opt/sfm/bin/CIMUtil -e root/cimv2/npar HP_GiCAPManager 1> $TMP_FILE 2>
${TMP_FILE}_2
if [ $? -ne 0 ]
then
perform_log_rotation
LOG_DATE=$(date +"%x %X" 2>&1)
{
echo "Date: $LOG_DATE"
echo "Log Type: GiCAP Operation"
echo "Description: Any failure
occurs in GiCAP Database."
echo " $( cat $TMP_FILE
${TMP_FILE}_2 | tr -d '\r\n' )\n"
} >> $LOGFILE
rm $TMP_FILE ${TMP_FILE}_2
return 1
fi
#
# 2. Confirm if negative sharing rights symptom is occurring.
#
SH_Installed=$( cat $TMP_FILE | grep SD2SharingRightsInstalled | awk '{print
$3}' )
SH_InUse=$( cat $TMP_FILE | grep SD2SharingRightsInUse | awk '{print $3}' )
if [ `expr $SH_Installed - $SH_InUse` -lt 0 ]
then
perform_log_rotation
LOG_DATE=$(date +"%x %X" 2>&1)
{
echo "Date: $LOG_DATE"
echo "Log Type: GiCAP Operation"
echo "Description: Negative sharing
rights symptom is occurring. GiCAP_db must be recreated.\n"
} >> $LOGFILE
rm $TMP_FILE ${TMP_FILE}_2
return 1
fi
#
# 3. Confirm if this script is launched from either AGM or SGM.
#
AGM_Flag=$( cat $TMP_FILE | grep ControlStatus | awk '{print $3}' )
/usr/sbin/icapmanage -s > $TMP_FILE
if [ $AGM_Flag -eq 1 ] # Active GM
then