Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: awk question
Try this:
awk '{if ($10 > WD) print $10}' WD=$WARNING_THRESHHOLD
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of David Green
Sent: Tuesday, June 08, 2004 7:11 PM
To: oracle-l_at_freelists.org
Subject: awk question
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_at_soe.sony.com elif [ $TBS_WARNING -gt 55 ]; then
./orastat -ts|mailx -s "TBS WARNING for $SID" dgreen_at_soe.sony.com fi
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html ----------------------------------------------------------------- ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Wed Jun 09 2004 - 08:39:47 CDT