kgb_domino_cluster_status.sh

来自「ibm tivoli monitor agent for lotus confi」· Shell 代码 · 共 72 行

SH
72
字号
#!/bin/ksh# Licensed Materials - Property of IBM# Restricted Materials of IBM## Copyright IBM Corp. 2006 All Rights Reserved.# US Government Users Restricted Rights - Use, duplication or# disclosure restricted by GSA ADP Schedule Contract with# IBM Corp.## Release Name: omdomino_dev## Description: Ping the Domino Server Cluster using the#              Domino agent(kgbclient.exe)## Parameters:#   CANDLEHOME, KGB_NOTESINIPATH, and KGB_INSTANCE_NAME#   set in the environment## Returns:#    0 - At least one server in the cluster responded;#    1 - The cluster is unavailable - none of the servers responded;#    2 - The server is not in a cluster;#    3 - Not configured#    4 - Not Domino user#    5 - WARNING, Domino Server stopping#    5 - WARNING, Domino Agent starting#======================================================## source dynarch.shl in a subshell so it does not modify the environmentbinArch=`( . $CANDLEHOME/bin/dynarch.shl $CANDLEHOME/registry/archdsc.tbl; setBinLibArchs $cArch gb; echo $binArch )`# make sure the notes.ini path exists#KGB_NOTESINIPATH=`echo $KGB_NOTESINIPATH | sed -e "s/notes.ini//g"`#if [ ! -d "$KGB_NOTESINIPATH" ]; then#  echo "KGB_Domino_Cluster_Status.sh: KGB_NOTESINIPATH : $KGB_NOTESINIPATH/notes.ini was not found, exiting..."#  exit 3#fi# determine the Lotus Domino base directoryLOTUSBASEDIR=`cat $KGB_NOTESINIPATH/notes.ini | grep -i NotesProgram | awk -F= {'print $2'}`while truedo  if [ -f $LOTUSBASEDIR/bin/server ]; then    break  else    LOTUSBASEDIR=`dirname $LOTUSBASEDIR`    if [ "$LOTUSBASEDIR" = "/" -o "$LOTUSBASEDIR" = "" ]; then      break    fi  fidoneif [ ! -f $LOTUSBASEDIR/bin/server ]; then  echo "KGB_Domino_Cluster_Status.sh: ${LOTUSBASEDIR} directory was not found, exiting..."  exit 3fi# chk to make sure the agent has been configuredif [ ! -f $LOTUSBASEDIR/bin/kgbclient ]; then  echo "KGB_Domino_Cluster_Status.sh: kgbconfig.sh has not been run on the monitoring agent for Domino"  exit 3fi# Get the cluster status return code# kgbclient is polling the cluster status every 30 seconds and writing status to a fileif [ -f $CANDLEHOME/$binArch/gb/bin/kgb_${KGB_INSTANCE_NAME}_status.out ]; then  RC=`cat $CANDLEHOME/$binArch/gb/bin/kgb_${KGB_INSTANCE_NAME}_status.out | sed -n '$p'`  exit $RCelse  exit 6fi

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?