HOW TO EMAIL SYSOUT

Several scripts
Post Reply
User avatar
Thomas
Nouveau
Nouveau
Posts: 5
Joined: 02 Jul 2010 12:00

HOW TO EMAIL SYSOUT

Post by Thomas » 02 Jul 2010 3:23

All,

We are running our Control-M server 6.3.01 on UNIX. I want to send sysout for the job for ENDEDOK/NOT OK conditions.

Can any one expalin the steps involved in this process?

Thanks in advance for your time and your response.

Thanks
Tom

User avatar
YOWAL
Nouveau
Nouveau
Posts: 18
Joined: 07 Jan 2009 12:00
Location: Argentina, Buenos Aires

Post by YOWAL » 05 Jul 2010 9:37

hi,

1 -
+------------------------------------------------+
| CONTROL-M System Maintenance Utility |
| Main Menu |
+------------------------------------------------+

1) Shout Destination Tables
2) System Parameters
q) Quit

Enter Option:1

--> option 1 (Create/Modify a Table)
--> option enter SYSTEM
--> yes
--> new entry program, server

2 - from step 'PostProc':

When NOTOK to CTMATTACHSYSOUT Message %%ORDERID %%MEMNAME address@domain.com

Script:

SYSOUT=/controlm63/ctmsrv/tmp

ORDERID=`echo $2 |cut -d " " -f 1`
JOBNAME=`echo $2 |cut -d " " -f 2`

MAIL1=`echo $2 |cut -d " " -f 3`
MAIL2=`echo $2 |cut -d " " -f 4`
MAIL3=`echo $2 |cut -d " " -f 5`

ctmpsm -LISTSYSOUT $ORDERID >$SYSOUT/$JOBNAME

uuencode $SYSOUT/$JOBNAME $JOBNAME.txt | mailx -s "Ejecucion de job $JOBNAME" $MAIL1 $MAIL2 $MAIL3
exit 0

vassi168

Post by vassi168 » 06 Jul 2010 11:48

Hallo,
we run 6.3.01.500 on Solaris machine.
The 6.3.012 version can send the sysout to mail but if you want in some jobs only to to send then you have to make a script.

We have a script to attach the sysout to mail:
In the script is:

SUBJECT=`echo $* | cut -f '4-' -d " "`
export SUBJECT
DESTINATION=`echo $* | cut -f '3' -d " "`
/......./ctm_server/exe_Solaris/ctmpsm -listsysout $2 >/tmp/mailsysout_ctmbsp.tmp
echo $* >> /tmp/mailsysout_ctmbsp.tmp
echo $SUBJECT >> /tmp/mailsysout_ctmbsp.tmp
echo $DESTINATION >> /tmp/mailsysout_ctmbsp.tmp
/usr/bin/mailx -r "control_m@....de" -s "$SUBJECT" $DESTINATION </tmp>/tmp/mailsysout_ctmbsp.l
og 2>&1
echo $? >>/tmp/mailsysout_ctmbsp.tmp


On the second:
in the shout destinetion table we have a shout to "mail" where we call the script "mailsysout"

And third:
In the job you must make a shout to "mail" with

%ORDERID "email adress" Text

I hope a have help you
Vassilis

User avatar
Thomas
Nouveau
Nouveau
Posts: 5
Joined: 02 Jul 2010 12:00

Post by Thomas » 15 Jul 2010 5:03

YOWAL,

Thanks very much for your reply. Your code working perfectly fine. However I am getting the Result: Success. at the end of the output in the attchment. Even if the job fails the output is displaying that message. Some times the users may get confused.

How to remove Result: Success from the output of failed job?

Thanks
Tom

User avatar
kylo_h
Nouveau
Nouveau
Posts: 57
Joined: 13 May 2008 12:00

Post by kylo_h » 23 Nov 2010 3:46

Another way of doing this is by editing the config.dat file.

On your Unix server, go to:

$HOME/ctm_server/data

vi the config.dat file and append the following to the end of the file (make sure you backup the original config.dat file first)

# E-mail Parameters
ADD_SYSOUT_TO_EMAIL A
ADD_SYSOUT_TO_EMAIL_LIMIT_SIZE 4000KB
MAIL_ADD_SUBJECT_PREFIX N


save and exit.

You will need to stop and start the Control-M server for it to take effect.

Post Reply