logo       

RE: DM Numeric custom script monitor: msg#00592

sysutils.tivoli.general

Subject: RE: DM Numeric custom script monitor

exit 0 is a program return code. What you send to standard out is read by the monitor and evaluated based on what you put in the trigger field you refered to.

Another example:

Put a file on a system that you can set the first line to some value (like Wazzup).

Put the following script on the machine.

#!/bin/sh

`cat /my_dir/my_dir/my_file`

exit 0

my_dir/my_dir is the directoy path to the file that your "watching" my_file is what you called the file you're watching.

Set the critical trigger to send an email to yourself when the response from the script is not equal to Wazzup. Set the warning trigger to send you an email when it's equal to Wazzup. You'll get the idea from this experiment.

PS If this is Unix you're testing on remember it's case sensitive.

Let the monitor run till it triggers then change the value in the my_file back and forth between Wazzup and somethng else.

Basically with ncustom and scustom you can do whatever you need to do with the monitor. Open and close local files grabbing information as you go, run local programs based on the results you find, send events to TEC, anything you can imagine. In the end the script can then send some result to STDOUT and the monitor can do further responses from there.

BTW: The output you send to STDOUT on a scustom can be a string including whitespaces. Just double-quote the value you're testing on if it does have white spaces. For instance you're script can send "Have a nice Day" then you can have the monitor test for that message as long as you double quote the trigger value (other wise your trigger willl just look for "Have").

I came into this world with nothing. And I have most of it left !

----Original Message Follows----
From: Redusj-pWz/JrSLlZPq+pQ9gifPwA@xxxxxxxxxxxxxxxx
Reply-To: tme10-XtjxT7Vmt5b1ENwx4SLHqw@xxxxxxxxxxxxxxxx
To: tme10-XtjxT7Vmt5b1ENwx4SLHqw@xxxxxxxxxxxxxxxx
Subject: RE: [tme10] DM Numeric custom script monitor
Date: Wed, 28 Apr 2004 16:27:08 -0500
MIME-Version: 1.0
Received: from e32.co.us.ibm.com ([32.97.110.130]) by mc1-f35.hotmail.com with Microsoft SMTPSVC(5.0.2195.6824); Wed, 28 Apr 2004 14:33:47 -0700
Received: from westrelay01.boulder.ibm.com (westrelay01.boulder.ibm.com [9.17.195.10])by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i3SLVGnU736942;Wed, 28 Apr 2004 17:31:16 -0400
Received: from d03mjd01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.193.81])by westrelay01.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i3SLTeNQ489808;Wed, 28 Apr 2004 15:31:15 -0600
Received: (from mjrdomo-bi+AKbBUZKZeoWH0uzbU5w@xxxxxxxxxxxxxxxx)by d03mjd01.boulder.ibm.com (8.12.10/8.12.10) id i3SLTcOI022744;Wed, 28 Apr 2004 15:29:38 -0600
X-Message-Info: EoYTbT2lH2OKgyqCngsdtn8C9xag2uTN
Message-ID: <BD65682D9E1EAD44AFB17306800D04C00C2790A5-lyQvztJkUMI@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
X-Mailer: Internet Mail Service (5.5.2657.72)
Precedence: bulk
Return-Path: owner-tme10-XtjxT7Vmt5b1ENwx4SLHqw@xxxxxxxxxxxxxxxx
X-OriginalArrivalTime: 28 Apr 2004 21:33:48.0827 (UTC) FILETIME=[7E1376B0:01C42D68]
Brian,
I think the idea is to print a numeric value to stdout, but exit with a
zero.
As in:
---------------------------------
#!/bin/sh
# Count the number of processes :
PS_COUNT=`ps -ef|wc -l`
echo $PS_COUNT
exit 0
---------------------------------
hth,
James
> -----Original Message-----
> From: Brian Kraftchick [SMTP:Brian.Kraftchick-MRmd0vlZXUo@xxxxxxxxxxxxxxxx]
> Sent: Wednesday, April 28, 2004 4:08 PM
> To: Tme10 (E-mail)
> Subject: [tme10] DM Numeric custom script monitor
>
> FW 3.7.1 on Win2K
>
> I have a question that I'm assuming is only a question to me because I
> don't quite understand something, so hopefully any answers will clear this
> up.  What is the purpose of a numeric custom script monitor's response
> level parameters being selectable (meaning you can enter any numbered
> value as the threshold), if any script that is run and returns anything
> other than a 0 produces an E.Exec and ultimately a monitor failure.  In
> other words....when setting up the monitor and editing the response
> levels, why even be allowed to key in different numbers when it appears
> that numeric custom script monitors only work completely when the script
> exits with a 0...exiting with anything else causes the E.Exec response.
>
> Thanks in advance for any insight !
>
> Brian Kraftchick
> Network Administrator
> Old Dominion Freight Line
> Ph: (336) 822-5938
> Fax: (336) 822-5149
> E-mail: brian.kraftchick-MRmd0vlZXUo@xxxxxxxxxxxxxxxx <mailto:brian.kraftchick-MRmd0vlZXUo@xxxxxxxxxxxxxxxx>
> Web Site: www.odfl.com <http://www.odfl.com/>
>
>


Test your ?Travel Quotient? and get the chance to win your dream trip!
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise