Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> awk question

awk question

From: David Green <thump_at_cosmiccooler.org>
Date: Tue, 8 Jun 2004 18:11:20 -0500 (CDT)
Message-ID: <4629.64.37.154.251.1086736280.squirrel@www.cosmiccooler.org>


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



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 Tue Jun 08 2004 - 18:08:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US