建设工作站服务器
#! /usr/bin/ksh
# author:Rui张
#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\\ & amp; quot; %f\\\&; quot; `
log _ name=/tmp/tday _ log/10.4.57.129 _ tday _ ` date\& amp; quot; %f\\\&; quot; log
yday=`tz=AAA24date\\\&; quot; %a%b%d\\\&; quot;
tday=`date\\&; quot; %a%b%d\\\&; quot;
yday_num=`tz=AAA24date\\\&; quot; %f\\\&; quot; `
tday_num=`date \\\&; #039; %F\\\&; quot; `
yday_MD=`tz=AAA24date\\\&; quot; %m%d\\\&; quot; *`tz=AAA24date\\\&; quot; %y\\\&; quot;
tday_MD=`date\\\&; quot; %m%d\\&; quot; *`date\\\&; quot; %y\\\&; quot; `
yday_lis=`tz=AAA24date\\\&; quot; %d-%b-%y\\\&; quot; |tr\\\&; #039; [a-z]\\\\\\&; quot; \&; quot; \&; quot; \\\\\&; quot; [a-z]。
tday_lis=`date\\\&; quot; %d-%b-%y\\\&; quot; |tr\\\&; quot; [a-z]\\\\\&; quot; \\&; quot; \\\\\\&; quot; ( [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/messages # # # # # # # # # # # # # # # # # # # # # #
echo $log_name
echo $log_name
errpt | head -1 $log_name
errpt|egrep $ { yday _ MD }|$ { tday _ MD } $ log _ name
#egrepjul\\\&; quot; 3|jul\\&; quot; 2/var/log/messages$log_name
echo $log_name
函数chk _ db _ log {
file_name=$1
count_1=0
while读线
do
# count_1=$[$count_1 1];
let count_1=1
day _ mid=$ ( echo $ line|egrep $ { yday } ) ) ) ) ) ) ) day _ mid=$ ( echo $ line|$ { tday } ) ) ) ) ) ) 65
if [[ -n $day_mid ]]; then
布莱克
fi
done $file_name
count _3=` WC-l $ { file _ name }|awk {\& amp; quot; 打印$1\\& amp; quot; } `
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读线
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读线
do
# count_1=$[$count_1 1];
let count_1=1
day _ mid=$ ( echo $ line|egrep $ { yday _ num }|$ { tday _ num } ) )
if [[ -n $day_mid ]]; then
布莱克
fi
# echo $line
#echo $count_1
#done\\\&; quot;/u01/app/Oracle/diag/RDBMS/test/test1/trace/alert _ test1.log\& amp; quot;
done $file_name
#echo $count_1
count _3=` WC-l $ { file _ name }|awk {\& amp; quot; 打印$1\\& amp; quot; } `
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读线
do
# count_2=$[$count_2 1]
let count_2=1
if ( ) $count_2=count_1); then
echo $line $log_name
fi
#done\\\&; quot;/u01/app/Oracle/diag/RDBMS/test/test1/trace/alert _ test1.log\& amp; quot;
done $file_name
echo $log_name
}
函数chk _ listener _ log {
file_name=$1
count_1=0
while读线
do
# count_1=$[$count_1 1];
let count_1=1
day _ mid=$ ( echo $ line|egrep $ { yday _ lis }|$ { tday _ lis } ) )
if [[ -n $day_mid ]]; then
布莱克
fi
# echo $line
#echo $count_1
#done\\\&; quot;/u01/app/Oracle/diag/RDBMS/test/test1/trace/alert _ test1.log\& amp; quot;
done $file_name
#echo $count_1
count _3=` WC-l $ { file _ name }|awk {\& amp; quot; 打印$1\\& amp; quot; } `
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读线
do
# count_2=$[$count_2 1]
let count_2=1
if ( ) $count_2=count_1); then
echo $line $log_name
fi
#done\\\&; quot;/u01/app/Oracle/diag/RDBMS/test/test1/trace/alert _ test1.log\& amp; quot;
done $file_name
echo $log_name
}
#echo $count_1
echo # # # # # # # # # # # # # # # # # # # # # # # db _ log # # # # # # # # # # log # # # # # # # # # # # # # # # # # # # # # # # # #
echo $log_name
echo $log_name
chk _ db _ log/u01/app/Oracle/diag/RDBMS/ebiz/ebiz1/trace/alert _ ebiz1. log
echo # # # # # # # # # # # # # # # # # # # # # log # # # # # # # # # ASM _ log # # # # # # # # # # # # # # # # # # # # # # # #
echo $log_name
echo $log_name
chk _ db _ log/u01/app/grid/diag/ASM/ASM/as m1/trace/alert _ as m1.log
echo # # # # # # # # # # # # # grid _ log # # # # # # # # # grid _ log # # # # # # # # # # # # # # # # # # # # # # # # # # # #
echo $log_name
echo $log_name
chk _ grid _ log/u01/app/11.2.0.3/grid/log/EC pdb1/alertecpdb1. log
echo # # # # # # # # # # # listener _ log # # # # # # # # # # # # # listener _ log # # # # # # # # # # # # # # # # # # # # # # # # # # # listener
echo $log_name
echo $log_name
# # # # # # # 11g # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
chk _ grid _ log/u01/app/grid/diag/tnslsnr/EC pdb1/listener/alert/log.XML
# # # # # # # 11g # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # 10g # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# chk _ listener _ log/u01/app/Oracle/diag/tnslsnr/zhangr/listener/trace/listener.log
# # # # # # # 10g # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
详情请访问云服务器、域名注册、虚拟主机的问题,请访问西部数码代理商官方网站: www.chenqinet.cn