Shout to Program

Post Reply
User avatar
creaseypaul
Nouveau
Nouveau
Posts: 6
Joined: 09 Jan 2010 12:00

Shout to Program

Post by creaseypaul » 18 Jan 2010 10:44

Hi guys,

I want to set up shouts to a program, the idea being that the program will then update a database of job failures and overruns, which we can use for automation and trend analysis.

I think i have a good idea of what is required, i will outline the steps i plan to take, please correct if needed!

1) run ctmsys and add a shout destination like the following

Destination = P
Adr = S
Logical Name = myName
Physical Name = /bin/myprogram.sh

note: i assume the only difference between Adr = S and A is the server the physical Name points at, if it's S it's on the ctm server if its A then it will point to the server specified in the node ID/Group, please confirm if this is correct.

2) Add a shout to the job as follows (I don't remember the exact options)

WHEN: NOTOK
Destination: myName
Severity: Urgent
Message: "Jobname: %%JOBNAME RUN: %%RUNCOUNT DESCRIPTION: %%DESCRIPTION STATUS: NOTOK command: %%COMMAND PARM1: %%PARM1 Date:$$ODATE"

Is this kind of message valid? I assume this is how it will work!

What will my program see, i assume it will be eqivelant to
/bin/myprogram.sh <Message> <Urgency>

What happens if the program fails, and returns a non 0 exit code?

Is there any parameter that include the SYSOUT (or the path to the sysout?)location

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 19 Jan 2010 6:54

1)
all correct
2)
try it , i know that you can

regards
philmalmaison

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 19 Jan 2010 7:19

creaseypaul,
regarding the sysout, if the question is to access the sysout as part of the shout script, you may use ctmpsm -LISTSYSOUT.
Since ctmpsm is ORDERID driven, you shoul pass %%ORDERID as part of the message text.
Regarding your message text, it looks OK. If you intend to parse it inside your script, you have to determine which parameter is which. I dont remember which is $1 (or %1), but I think the urgency of the shout is always passed as first parm.
Check that by running a first sript which simply echo $1, $2 etc..

At last, it happened in some tests I did that some response to SHOUT script commands appear in the jobs sysout

Good luck
Nicolas_mulot

User avatar
creaseypaul
Nouveau
Nouveau
Posts: 6
Joined: 09 Jan 2010 12:00

Post by creaseypaul » 20 Jan 2010 4:27

Does anybody know a variable that can be used to pass the job description as part of the shout, like %%DESCRIPTION (that doesn't work!)

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 20 Jan 2010 6:01

creaseypaul,

What you need and does not exist, create it.

You can develop a routine which scans the entire list of job def, and insert for any object (either job or SG) a %%DESC local variable which contain all or part of the DESCRIPTION field. Check for length compatibility between description and AutoEdit value.

The method used depends on your skills:
You can perl against an expordeftable output or a ctmexdef output
You can SQL against the EM database
You can SQL against the ctm database
..others ..

Be careful however. I bitterly experienced that AutoEdit variable abuse can lead to considerable performance degradation. I have to admit I exagerated.

Cheers
Nicolas_Mulot

User avatar
oyooman
Nouveau
Nouveau
Posts: 7
Joined: 17 Sep 2010 12:00

Post by oyooman » 04 Mar 2014 3:34

hello,


does it still the same for V.7 version of CTM still not %%DESC variable ?
=> already searched and no its not handled by CTM


to be more clear what i'm triying to do:
export a flat files for CTM server with fields:
Datacenter:jboname:orderid:description

and try to recover it in an autoedit variable

like in shell :
%%DESC=grep %%DATACENTER:%%JOBNAME vartest.lis | cut -d : -f 3

but i dont think such syntax works with autoedit Vars.

i'm stuck cause i cannot find enough documentation / info on the subject..
only doc / post speaks of Date calculation / or fixed Var in autoedit.

in order not to decrease DB performances.

thx in advance.

Post Reply