文件:processinfo.sh
路径:$HOME/ggscript/ggupload
功能:该脚本为满足维护配置时检查所有goldengate进程的详细源端目标端,定义文件等信息而设计
如果未按照脚本部署准备进行内容注释,输出结果会为空
如果有其他注释信息,输出结果会被干扰
#!/bin/bashexport PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin" echo "This sciprt is write by RenYi"hn=`echo $HOSTNAME`usr=`echo $USER`echo $hn-$usrcd $HOME/ggserver(echo info all;echo exit)|./ggsci|grep -E "EXTRACT|REPLICAT" |awk 'BEGIN {FS=" +"} {print $3}' > $HOME/ggscript/ggupload/tempcd $HOME/ggscript/gguploadcat temp |tr A-Z a-z > temp2sed 's/$/.prm/' temp2 > temp3rm -f temp2i=1num=`sed -n '$=' temp3`echo -n -e "+-----------------------------------------------------------------------------------------------------------------------------+\n"printf "%-1s %-15s %-1s %-15s %-1s %-16s %-1s %-12s %-1s %-16s %-1s %-15s %-1s %-16s %-1s\n" \| process \| source \| sourceip \| target \| targetip \| defsfile \| defprm \|cd $HOME/ggserver/dirprmwhile [ "$i" -le "$num" ]do fname=`sed -n $i'p' $HOME/ggscript/ggupload/temp3` pname=`sed -n $i'p' $HOME/ggscript/ggupload/temp` source=`cat $fname|grep -w "source" |cut -d ':' -f 2` while [ ${#source} -le 2 ] do source=none done sourceip=`cat $fname|grep -w "sourceIP" |cut -d ':' -f 2` while [ ${#sourceip} -le 2 ] do sourceip=none done target=`cat $fname|grep -w "target" |cut -d ':' -f 2` while [ ${#target} -le 2 ] do target=none done targetip=`cat $fname|grep -w "targetIP" |cut -d ':' -f 2` while [ ${#targetip} -le 2 ] do targetip=none done defsfile=`cat $fname|grep -w "defsfile" |cut -d ':' -f 2` while [ ${#defsfile} -le 2 ] do defsfile=none done defprm=`cat $fname|grep -w "defprm" |cut -d ':' -f 2` while [ ${#defprm} -le 2 ] do defprm=none done echo -n -e "+-----------------------------------------------------------------------------------------------------------------------------+\n" printf "%-1s %-15s %-1s %-15s %-1s %-16s %-1s %-12s %-1s %-16s %-1s %-15s %-1s %-16s %-1s\n" \| $pname \| $source \| $sourceip \| $target \| $targetip \| $defsfile \| $defprm \| ((i++));donecd $HOME/ggscript/gguploadecho -n -e "+-----------------------------------------------------------------------------------------------------------------------------+\n"
查询结果