Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: one last awk question for tbs monitoring...
Either a while loop or do all the work within an awk script to give you more
manageability.
Cheers,
Vasan.
-----Original Message-----
From: David Green [mailto:thump_at_cosmiccooler.org]
Sent: 11 June 2004 16:40
To: oracle-l_at_freelists.org
Subject: one last awk question for tbs monitoring...
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
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.htmlReceived on Mon Jun 14 2004 - 07:32:51 CDT
-----------------------------------------------------------------
___________________________________________________________________________ This email and any attached to it are confidential and intended only for the individual or entity to which it is addressed. If you are not the intended recipient, please let us know by telephoning or emailing the sender. You should also delete the email and any attachment from your systems and should not copy the email or any attachment or disclose their content to any other person or entity. The views expressed here are not necessarily those of Churchill Insurance Group plc or its affiliates or subsidiaries. Thank you. Churchill Insurance Group plc. Company Registration Number - 2280426. England. Registered Office: Churchill Court, Westmoreland Road, Bromley, Kent BR1 1DP.
----------------------------------------------------------------
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
-----------------------------------------------------------------
![]() |
![]() |