[TriLUG] OT - script help
Shane O'Donnell
shaneodonnell at gmail.com
Fri Jul 8 14:10:48 EDT 2005
Definitely!! And don't put any comments on it, so the next guy will
be confused by what you did, then have to re-do your comparator when
the threshold changes to anything other than 100.
Programmers live for that stuff. ;-)
Tongue firmly in cheek,
Shane O.
On 7/8/05, Warren Myers <volcimaster at gmail.com> wrote:
> Couldn't you also just match the string length exceeding 2? by definition, a
> 3 character string must be an int at least 100 (presuming it's a number).
>
> WMM
>
> On 7/8/05, Ryan Leathers <Ryan.Leathers at globalknowledge.com> wrote:
> >
> > just convert the resulting string to an integer so you can compare to see
> > if its larger than your threshold.
> >
> >
> > -----Original Message-----
> > From: trilug-bounces at trilug.org on behalf of Howard Boyd
> > Sent: Fri 7/8/2005 12:52 PM
> > To: trilug at trilug.org
> > Subject: [TriLUG] OT - script help
> >
> > 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
> > **************************************************************
> > --
> > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ : http://trilug.org/faq/
> > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
> >
> >
> >
> > --
> > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ : http://trilug.org/faq/
> > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
> >
> >
>
>
> --
> http://warrenmyers.com
> "God may not play dice with the universe, but something strange is going on
> with the prime numbers." --Paul Erdős
>
> --
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
>
>
--
Shane O.
========
Shane O'Donnell
shaneodonnell at gmail.com
====================
More information about the TriLUG
mailing list