OGG运维优化脚本-查询维护类--进程详细信息查询
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OGG运维优化脚本-查询维护类--进程详细信息查询相关的知识,希望对你有一定的参考价值。
文件:processinfo.sh
路径:$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"
查询结果
本文出自 “netsman” 博客,请务必保留此出处http://netsman.blog.51cto.com/5750076/1939640
以上是关于OGG运维优化脚本-查询维护类--进程详细信息查询的主要内容,如果未能解决你的问题,请参考以下文章