用飛信監控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"
相關文章
相關標籤/搜索