用飞信监控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"
posted @ 2015-02-25 14:10  jimeper  阅读(418)  评论(0编辑  收藏  举报