91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

獲取兩天內的告警日志(AIX|ksh|shell|oracle)

發布時間:2020-08-11 19:36:46 來源:ITPUB博客 閱讀:205 作者:zhangsharp20 欄目:建站服務器
#!/usr/bin/ksh
#author: Rui Zhang
#date: 2017-08-09
#email: sharpzhang_2008@126.com 


export LANG=en_US.UTF-8


dir_name=/tmp/tday_log/
log_name=/tmp/tday_log/tday_log_`date +'%F'`
log_name=/tmp/tday_log/10.4.57.129_tday_`date +'%F'`.log
yday=`TZ=aaa24 date +'%a %b %d '`
tday=`date +'%a %b %d '`
yday_num=`TZ=aaa24 date +'%F'`
tday_num=`date +'%F'`
yday_md=`TZ=aaa24 date +'%m%d'`.*`TZ=aaa24 date +'%y'`
tday_md=`date +'%m%d'`.*`date +'%y'`
yday_lis=`TZ=aaa24 date +'%d-%b-%Y ' | tr '[a-z]' '[A-Z]'`
tday_lis=`date +'%d-%b-%Y ' | tr '[a-z]' '[A-Z]'`


if [ ! -d "$dir_name" ];then
  mkdir -p $dir_name
fi


if [ -f "$log_name" ];then
  rm -f $log_name
fi




echo "###########################/var/log/messages################################" >> $log_name
echo "" >> $log_name
echo "" >> $log_name
errpt | head -1 >> $log_name
errpt | egrep "${yday_md}|${tday_md}"  >> $log_name
#egrep "Jul\  3|Jul\  2" /var/log/messages >> $log_name
echo "" >> $log_name


function chk_db_log {
file_name=$1
count_1=0
while read line
do
#  count_1=$[$count_1+1];
let count_1+=1
day_mid=$(echo "$line" | egrep "${yday}|${tday}")
if [[ -n $day_mid ]];then
break
fi
done <$file_name


count_3=`wc -l ${file_name} |awk {'print $1'}`


if [ "$count_1" = "$count_3" ];then
# count_1=$[$count_1+1];
let count_1+=1
fi
echo "當前指針位置:${count_1} 文件行數:${count_3} 文件名:${file_name}"


count_2=0
while read line
do
#  count_2=$[$count_2+1]
let count_2+=1
if (($count_2>=count_1));then
echo "$line" >>$log_name
fi
done <$file_name


echo "" >> $log_name
}




function chk_grid_log {
file_name=$1
count_1=0
while read line
do
#  count_1=$[$count_1+1];
let count_1+=1
day_mid=$(echo "$line" | egrep "${yday_num}|${tday_num}")
if [[ -n $day_mid ]];then
break
fi
#  echo $line
#echo $count_1
#done <'/u01/app/oracle/diag/rdbms/test/test1/trace/alert_test1.log'
done <$file_name
#echo $count_1


count_3=`wc -l ${file_name} |awk {'print $1'}`


if [ "$count_1" = "$count_3" ];then
# count_1=$[$count_1+1];
let count_1+=1
fi
echo "當前指針位置:${count_1} 文件行數:${count_3} 文件名:${file_name}"


count_2=0
while read line
do
#  count_2=$[$count_2+1]
let count_2+=1
if (($count_2>=count_1));then
echo "$line" >>$log_name
fi
#done <'/u01/app/oracle/diag/rdbms/test/test1/trace/alert_test1.log'
done <$file_name


echo "" >> $log_name
}


function chk_listener_log {
file_name=$1
count_1=0
while read line
do
#  count_1=$[$count_1+1];
let count_1+=1
day_mid=$(echo "$line" | egrep "${yday_lis}|${tday_lis}")
if [[ -n $day_mid ]];then
break
fi
#  echo $line
#echo $count_1
#done <'/u01/app/oracle/diag/rdbms/test/test1/trace/alert_test1.log'
done <$file_name
#echo $count_1


count_3=`wc -l ${file_name} |awk {'print $1'}`


if [ "$count_1" = "$count_3" ];then
# count_1=$[$count_1+1];
let count_1+=1
fi
echo "當前指針位置:${count_1} 文件行數:${count_3} 文件名:${file_name}"


count_2=0
while read line
do
#  count_2=$[$count_2+1]
let count_2+=1
if (($count_2>=count_1));then
echo "$line" >>$log_name
fi
#done <'/u01/app/oracle/diag/rdbms/test/test1/trace/alert_test1.log'
done <$file_name


echo "" >> $log_name
}
#echo $count_1


echo "############################db_log##########################################" >> $log_name
echo "" >> $log_name
echo "" >> $log_name


chk_db_log /u01/app/oracle/diag/rdbms/ebiz/ebiz1/trace/alert_ebiz1.log


echo "############################asm_log#########################################" >> $log_name
echo "" >> $log_name
echo "" >> $log_name


chk_db_log /u01/app/grid/diag/asm/+asm/+ASM1/trace/alert_+ASM1.log


echo "############################grid_log########################################" >> $log_name
echo "" >> $log_name
echo "" >> $log_name


chk_grid_log /u01/app/11.2.0.3/grid/log/ecpdb1/alertecpdb1.log


echo "########################listener_log########################################" >> $log_name
echo "" >> $log_name
echo "" >> $log_name


##############11g###########################
chk_grid_log /u01/app/grid/diag/tnslsnr/ecpdb1/listener/alert/log.xml
##############11g###########################






##############10g###########################
#chk_listener_log /u01/app/oracle/diag/tnslsnr/zhangr/listener/trace/listener.log
##############10g###########################


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

镇雄县| 马鞍山市| 香河县| 房产| 沙洋县| 康马县| 嵊州市| 湘乡市| 白玉县| 东乡县| 厦门市| 通化县| 馆陶县| 阜新| 深圳市| 河曲县| 彭水| 厦门市| 合江县| 河间市| 休宁县| 安宁市| 新闻| 临安市| 蓝山县| 澄城县| 包头市| 金坛市| 雷州市| 峡江县| 通辽市| 长治市| 太仓市| 苏尼特右旗| 含山县| 丹东市| 宁武县| 卓尼县| 荃湾区| 郸城县| 朝阳区|