[TriLUG] OT - script help

Howard Boyd boydh at us.ibm.com
Fri Jul 8 12:52:20 EDT 2005


Could use some help w/ a simple script problem. I have written a simple 
script that will output the following line:

   QUEUE(IN.TECH.Q)                        CURDEPTH(0)

I'm interested in the number that appears between the parentheses after 
the word CURDEPTH. This number will vary depending on the health of my 
application. I want to script something that says if this number is 
greater than 100, send an email to me. 

For those who care, the number is the Queue Depth for the queue running on 
my MQ Series server. When this number is over 100, I want to be notified 
so that I can check on my application.

I can use: awk '{ print $2 ; }' curdepth.txt | sed -e 's/CURDEPTH(//' -e 
's/)//' > number.txt to strip away all the text except for the number (and 
I'm sure there is a more elegant solution), but how do I assign this to a 
variable that I can compare to my threshold point? 

Right now, I just want something functional and don't care about elegant. 
Any and all help is greatly appreciated! 

Howard

**************************************************************
* Then I realized that it is good and proper for a man to
* eat and drink, and to find satisfaction in his toilsome
* labor under the sun during the few days of life God has
* given him - for this is his lot. Moreover, when God gives
* any man wealth and possessions, and enables him to
* enjoy them, to accept his lot and be happy in his work -
* this is a gift of God. Ecclesiastes 5:18-19 NIV
**************************************************************


More information about the TriLUG mailing list