GoldenGate监控(八)

 

八、      监控GoldenGate进程
1)         goldengate安装目录下建立文件ogginfo
$vim ogginfo
 info all
2)         配置飞信报警
                                     下载飞信安装包http://down.51cto.com/data/240154
                                     $mkdir /usr/local/sms
                                     将飞信代码包上传到sms目录,并将所有者赋予oracle
3)         配置监控脚本vi /usr/local/bin/gg_monitor.sh
#!/bin/sh
#monitor goldengate process status
GG_DIR=/oracle/goldengate
cd $GG_DIR
./ggsci <ogginfo.sh |sed -n '/MANAGER/,/REPLICAT/p'|awk '{print $2}' >status.log
for i in `cat status.log`;do
 if [[ $i == RUNNING ]];then
      echo 0;
   else
     LD_LIBRARY_PATH=/usr/local/sms/ /usr/local/sms/fetion --mobile=15910683240 --pwd=123456 --to=15910683240 --msg-utf8="GoldenGate ERROR";
fi;
done;
4)         添加计划任务
                                     让系统每 10分钟执行一次检查
                                     #crontab –e
                                     */10 * * * * su  - oracle  -c "sh /usr/local/bin/gg_monitor.sh > /dev/null 2>&1"

本文出自 “赵海华_运维之路” 博客,谢绝转载!

你可能感兴趣的:(职场,监控,休闲,goldengate)