码迷,mamicode.com
首页 > 系统相关 > 详细

用飞信监控GoldenGate进程

时间:2015-02-25 15:23:49      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:

监控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进程

标签:

原文地址:http://www.cnblogs.com/jimeper/p/4299509.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!