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

Home -> Community -> Mailing Lists -> Oracle-L -> one last awk question for tbs monitoring...

one last awk question for tbs monitoring...

From: David Green <thump_at_cosmiccooler.org>
Date: Fri, 11 Jun 2004 10:40:00 -0500 (CDT)
Message-ID: <4681.64.37.154.251.1086968400.squirrel@www.cosmiccooler.org>


Okay, I think I almost have this...
I actually have already coded a working solution, but my original plan of using awk and not getting it to work is nagging me. Any pointers are appreciated.

Here is the code:
SID=$1
cd /m1/homes/oracle
. ./$SID export WARNING_THRESHOLD=55
export CRITICAL_THRESHHOLD=65

export TBS_WARNING=`orastat -ts | awk '{if ($10 > WARNING_THRESHOLD) print $10}' | grep -vi generic | grep -vi pct | grep -vi === | grep -vi listed | grep -vi accurat`
export TBS_CRITICAL=`orastat -ts | awk '{if ($10 > CRITICAL_THRESHHOLD) print $10}' | grep -vi generic | grep -vi pct | grep -vi === | grep -vi listed | grep -vi accurat`

if [ $TBS_CRITICAL -gt 60 ]; then

./orastat -ts|mailx -s "TBS CRITICAL for $SID" dgreen-email
elif [ $TBS_WARNING -gt 50 ]; then

./orastat -ts|mailx -s "TBS WARNING for $SID" dgreen-email
fi

Problem is that the values returned from awk to the TBS_ cariables are all on one row:

+ [ ----- 66.3 62.8 37.6 22.6 11.9 11.6 8.3 0.1 ----- -gt 60 ]
./check_tbs.bk[13]: 66.3: unknown test operator
+ [ ----- 66.3 62.8 37.6 22.6 11.9 11.6 8.3 0.1 ----- -gt 50 ]

Does that mean I have to setup something like a "while read line do" type of logic?

Thanks
- David



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 Fri Jun 11 2004 - 10:37:00 CDT

Original text of this message

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