Tuesday, January 29, 2013
GoldenGate Monitoring Script - Linux
GoldenGate Monitor Script - Linux
I run this every 10 minutes in a cron, it emails me if anything interesting happens. It also monitors 10g and 11g GoldenGate running on the same server.
#!/bin/ksh
NOTIFY="myemail@myprovider.com"
OIFS=$IFS
IFS="
"
NIFS=$IFS
function check {
OUTPUT=`$GG_HOME/ggsci << EOF
info all
exit
EOF`
}
function report {
for line in $OUTPUT
do
if [[ $(echo "${line}"|egrep 'STOP|ABEND' >/dev/null;echo $?) = 0 ]]
then
GRPNAME=$(echo "${line}" | awk -F" " '{print $3}')
GRPSTAT=$(echo "${line}" | awk -F" " '{print $2}')
GRPTYPE=$(echo "${line}" | awk -F" " '{print $1}')
case $GRPTYPE in
"MANAGER")
cat $GG_HOME/dirrpt/MGR.rpt | mailx -s "${HOSTNAME} - GoldenGate ${GRPTYPE} ${GRPSTAT}" $NOTIFY ;;
# "JAGENT")
# cat $GG_HOME/dirrpt/JAGENT.rpt | mailx -s "${HOSTNAME} - GoldenGate ${GRPTYPE} ${GRPSTAT}" $NOTIFY ;;
"EXTRACT"|"REPLICAT")
cat $GG_HOME/dirrpt/"${GRPNAME}".rpt |mailx -s "${HOSTNAME} - GoldenGate ${GRPTYPE} ${GRPSTAT}" $NOTIFY ;;
esac
fi
done
}
#Check 10g
GG_HOME=/u01/app/oracle/ogg10g; export GG_HOME
check
report
#Check 11g
GG_HOME=/u01/app/oracle/ogg; export GG_HOME
check
report
Labels:
GoldenGate,
Monitoring
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment