EOF
YESTERDAY=`cat /database/log/tns_log/yesterday.out` TODAY=`date ‘+%d-%b-%Y‘`
echo $YESTERDAY $TODAY
echo "HOSTTNS|Date|SID|PROGRAM|HOST|USER|IP|PORT|" >$PWDPATH/tns_`date +%Y%m%d`.txt
cd $PWDPATH grep -i $YESTERDAY `ls *.log` |grep ‘HOST=‘ |grep -v ‘listening on:‘ |grep -v ‘Listening on:‘ |grep -v ‘COMMAND=‘ |grep -v ‘192.168.6.33‘ |grep -v ‘192.168.4.45‘ |sed -e ‘s/\* (CONNECT_DATA=(SID=/|/g‘ \ -e ‘s/\* (CONNECT_DATA=(SERVICE_NAME=/|/g‘ \ -e ‘s/)(CID=(PROGRAM=/|/g‘ \ -e ‘s/)(HOST=/|/g‘ \ -e ‘s/))) \* (ADDRESS=(PROTOCOL=tcp//g‘ \ -e ‘s/)(USER=/|/g‘ \ -e ‘s/)(PORT=/|/g‘ \ -e ‘s/))(SID=/|/g‘ \ -e ‘s/)) \* (ADDRESS=(PROTOCOL=tcp//g‘ \ -e ‘s/\* (CONNECT_DATA=(CID=(PROGRAM=/|/g‘ \ -e ‘s/)(CID=(PROGRAM=/|/g‘ \ -e ‘s/))(SERVICE_NAME=/|/g‘ \ -e ‘s/)) \* establish \* *.* \* *.*/|/g‘ >>$PWDPATH/tns_`date +%Y%m%d`.txt
cat tns_`date +%Y%m%d`.txt |grep -v 192.168.3.91 |grep -v 192.168.3.92 |grep -v 192.168.61.33 |grep -v 192.168.61.35 |grep -v 192.168.61.37 |grep -v 192.168.61.32 |grep -v 192.168.4.60|grep -v 192.168.3.90|grep -v 192.168.4.12 |grep -v 192.168.4.19 |grep -v 192.168.4.20 |grep -v 192.168.1.53|grep -v 192.168.4.21 |grep -v 1 92.168.6.14 |grep -v 192.168.6.70|grep -v 192.168.6.20 |grep -v 192.168.4.31 |grep -v 192.168.6.65 |grep -v 192.168.6.19|grep -v 192.168.200.10 |grep -v 192.168.6 .74 |grep -v 192.168.4.144 |grep -v 192.168.4.10 |grep -v 192.168.108.62|grep -v 192.168.3.8 |grep -v 192.168.24.30|grep -v 192.168.24.43|grep -v 192.168.16.195|g rep -v 192.168.63.160| grep -v 192.168.6.60|grep -v 192.168.6.63 |grep -v 192.168.4.24 |grep -v 192.168.23.15|grep -v 192.168.23.36 |grep -v 192.168.23.16 |grep - v 192.168.23.38 |grep -v 192.168.6.25 |grep -v 192.168.1.51 |grep -v 192.168.23.7 |grep -v 192.168.1.43 |grep -v 192.168.1.47 |grep -v 192.168.24.31|grep -v 192.1 68.24.32|grep -v 192.168.24.85 |grep -v 192,168.1.63|grep -v 192.168.1.64 |grep -v 192.168.3.71|grep -v 192.168.24.8|grep -v 192.168.63.113|grep -v 192.168.16.54| grep -v 192.168.4.82|grep -v 192.168.4.32|grep -v 192.168.2.223|grep -v 192.168.4.81|grep -v 192.168.4.80|grep -v 192.168.4.22|grep -v 10.200.7.101|grep -v 192.16 8.4.18|grep -v 192.168.1.46|grep -v 192.168.6.95|grep -v ‘192.168.23.8|‘|grep -v 172.18.193.12|grep -v -i pacer.exe|grep -v -i yictrpt.exe|grep -v 192.168.3.93|gr ep -v 172.17.7.11|grep -v 172.17.7.12|grep -v 192.168.23.87|grep -v 192.168.4.58|grep -v 192.168.23.41|grep -v 192.168.23.42|grep -v 192.168.24.7|grep -v 192.168. 23.86|grep -v 192.168.23.90|grep -v 192.168.201.122|grep -v 192.168.2.182|grep -v 192.168.3.72|grep -v 192.168.4.36|grep -v 192.168.4.85| grep -v 192.168.23.80|gr ep -v 192.168.6.69|grep -v 192.168.6.27 |grep -v 192.168.6.28|grep -v 192.168.4.45|sed -e ‘s/.log:/|/g‘ >$PWDPATH/tns_dbconnection`date +%Y%m%d`.txt
#sed -e ‘s/$/ /‘ $PWDPATH/tns_dbconnection`date +%Y%m%d`.txt >$PWDPATH/1 #(echo "DB doubtable connections at $YESTERDAY: \n\nyou may open it by notepad.exe or wordpad.exe or office excel.\n";/usr/bin/uuencode 1 1) |/bin/mailx -s "DB d oubtable connections at $YESTERDAY:" [email protected]
(echo "DB doubtable connections on $YESTERDAY: \n\nyou may open it by notepad.exe or wordpad.exe or office excel.\n") |/bin/mailx -s "DB doubtable connections at $YESTERDAY:" [email protected] <$PWDPATH/tns_dbconnection`date +%Y%m%d`.txt #(echo "DB doubtable connections on $YESTERDAY: \n\nyou may open it by notepad.exe or wordpad.exe or office excel.\n") |/bin/mailx -s "DB doubtable connections at $YESTERDAY:" [email protected] <$PWDPATH/tns_dbconnection`date +%Y%m%d`.txt
#(echo "DB doubtable connections at $YESTERDAY: \n\nyou may open it by notepad.exe or wordpad.exe or office excel.\n";/usr/bin/uuencode tns_dbconnection`date +%Y% m%d`.txt tns_dbconnection`date +%Y%m%d`.txt) |/bin/mailx -s "DB doubtable connections at $YESTERDAY:" [email protected]