$vim ogginfo
info all
下载飞信安装包http://down.51cto.com/data/240154
$mkdir /usr/local/sms
将飞信代码包上传到sms目录,并将所有者赋予oracle
#!/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;
让系统每10分钟执行一次检查
#crontab –e
*/10 * * * * su - oracle -c "sh /usr/local/bin/gg_monitor.sh > /dev/null 2>&1"