awk question

  • From: "David Green" <thump@xxxxxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Tue, 8 Jun 2004 18:11:20 -0500 (CDT)

Can someone please fill me in on if and how I can use the commented out
threshhold variables(after uncommenting) and reference those variables in
my awk test/evaluation in place of the hardcoded values($10 > 55 or 65).
Thanks
- David

#!/bin/ksh

SID=$1
cd /m1/homes/oracle
. ./$SID

#export WARNING_THRESHHOLD=55
#export CRITICAL_THRESHHOLD=65

export TBS_WARNING=`orastat -ts | awk '{if ($10 > 55) print $10}' | grep
-vi generic | grep -vi pct | grep -vi === | gr
ep -vi listed | grep -vi accurat`
export TBS_CRITICAL=`orastat -ts | awk '{if ($10 > 65) print $10}' | grep
-vi generic | grep -vi pct | grep -vi === | g
rep -vi listed | grep -vi accurat`

echo $TBS_WARNING
echo $TBS_CRITICAL

if [ $TBS_CRITICAL -gt 65 ]; then
        ./orastat -ts|mailx -s "TBS CRITICAL for $SID" dgreen@xxxxxxxxxxxx
elif [ $TBS_WARNING -gt 55 ]; then
        ./orastat -ts|mailx -s "TBS WARNING for $SID" dgreen@xxxxxxxxxxxx
fi
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: