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
HOW TO EMAIL SYSOUT
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
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
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
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
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
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
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.
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.