OGG运维优化脚本(十)-查询维护类--进程详细信息查询
文件:processinfo.sh
专注于为中小企业提供成都做网站、网站建设、外贸营销网站建设服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业乐山免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了1000多家企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。
路径:$HOME/ggscript/ggupload
功能:该脚本为满足维护配置时检查所有goldengate进程的详细源端目标端,定义文件等信息而设计
如果未按照脚本部署准备进行内容注释,输出结果会为空
如果有其他注释信息,输出结果会被干扰
#!/bin/bash export 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-$usr cd $HOME/ggserver (echo info all;echo exit)|./ggsci|grep -E "EXTRACT|REPLICAT" |awk 'BEGIN {FS=" +"} {print $3}' > $HOME/ggscript/ggupload/temp cd $HOME/ggscript/ggupload cat temp |tr A-Z a-z > temp2 sed 's/$/.prm/' temp2 > temp3 rm -f temp2 i=1 num=`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/dirprm while [ "$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++)); done cd $HOME/ggscript/ggupload echo -n -e "+-----------------------------------------------------------------------------------------------------------------------------+\n"
查询结果
本文题目:OGG运维优化脚本(十)-查询维护类--进程详细信息查询
链接URL:http://hbruida.cn/article/gjpcjj.html