OBIEE Scripts : A Script to check the Errors reported in nqsquery log and nqserver log.
I have created small scripts to identify the errors noted in nqslog. The script will check the errors reported in current day and send it as mail
#!/bin/sh
fPath='file path for nqslog and nqsserver'
hfile="Outputfile"
hfile2="Outputfile"
lPath='output file path'
touch -t `date +%y%m%d0000` $lPath/$$
find "$fPath" -type f -newer $lPath/$$ | grep "nqquery">Nqquery.out
find "$fPath" -type f -newer $lPath/$$ | grep "nqserver">Nqserver.out
rm $lPath/$$
#find "$fPath" `pwd` -mtime -1 -type f -print | grep "nqquery">Nqquery.out
#find "$fPath" `pwd` -mtime -1 -type f -print | grep "nqserver">Nqserver.out
echo ""> Nqquery.txt
while read f;do
echo "Processing $f"
fname=`basename $f`
echo "---$Path/$fname---"
echo "--------------------------$Path/$fname-------------------------------------------------------------------" >>Nqquery.txt
cat $fPath/$fname | grep "nQSError" >>Nqquery.txt
#echo "Hi"
done <$hfile
echo ""> Nqserver.txt
while read f;do
echo "Processing $f"
fname=`basename $f`
echo "---$Path/$fname---"
echo "--------------------------$Path/$fname-------------------------------------------------------------------" >>Nqserver.txt
cat $fPath/$fname | grep "ERROR:1" >>Nqserver.txt
#echo "Hi"
done <$hfile2
You can use mailx to send this to your mailbox
mailx -s "OBIEE Error Log" mail id << EOF
Hi All,
PFA List of NQQuery and NQserver Failures for today
Thanks,
~< ! uuencode $lPath/Nqquery.txt Nqquery.txt; uuencode $lPath/Nqserver.txt Nqserver.txt
~.
EOF
Comments
Post a Comment