MEXICO -- HELP OM SENDING eMAILS USING DO MAIL

Tools and several solutions to manage Control-M products
Post Reply
User avatar
ACAMACRU
Nouveau
Nouveau
Posts: 1
Joined: 16 Jul 2012 12:00

MEXICO -- HELP OM SENDING eMAILS USING DO MAIL

Post by ACAMACRU » 16 Jul 2012 6:28

Can anyone from MExico help me to use the ON and the Do mAIL???

I am tryig since the job definition interfase...
I want to send an email with the sysout as an atachmente

User avatar
markf
Nouveau
Nouveau
Posts: 134
Joined: 13 Jul 2006 12:00
Location: Switzerland
Contact:

Post by markf » 23 Jul 2012 4:57

This can be done automatically if you have a recent version of Control-M. If you only have version 6.3.1 or earlier then -

1. Save the %%ORDERID and %%JOBNAME via DO Set-Var and FORCE another job in.

2. The FORCED job should have this on the CMDLINE -

ctmpsm -LISTSYSOUT %%YOUR_ORDERID | mailx -s "ERROR - %%YOUR_JOBNAME failed" me@hotmail.com

where %%YOUR_ORDERID and %%YOUR_JOBNAME are the values created in step 1.

Janctm

How to save %%ORDERID and %%JOBNAME via DO Set-Var

Post by Janctm » 08 Aug 2012 2:30

Hello,

I have read your post and like to use this too, but to me it will not work. I don't know what i am doing wrong.

The vars are still empty when i use set-var.

1 Tab steps : Do Set-var %%ORDERID_X = %%ORDERID

In the log i see:
DO SETVAR '%%ORDERID_X'='%%ORDERID' performed

On the server the var is empty
controlm [18] echo $ORDERID_X
ORDERID_X: Undefined variable

Can you please send the complete syntax ?
I'am using controlm 6.2

vassi168

Post by vassi168 » 09 Aug 2012 7:03

Hello Janctm,
when we were in the 6.2 version (now we are on version 7.o), we used a shout (behind the shout was a script and I must give as Parameter the %%ORDERID ,the email adress and the Subject) to send a mail with the sysout as a atachmente.
So you can use the same thing "on do" stattment.
You don't use"do mail" instead you use "do shout"
If you want i can send you the script (for Linux)

regards
Vassilis

Janctm

Post by Janctm » 09 Aug 2012 7:58

Hello vassi168,

I like to have the script. Can you put it here ? (into the form)

And can you tell me how to configue controlm?

Tab. Steps
On Stmt=* COMPSTAT>0
Do Shout Destination ?
MSG ?

Thanks

vassi168

Post by vassi168 » 09 Aug 2012 12:05

Hello Janctm,
hier are the script

!/bin/ksh

SUBJECT=`echo $* | cut -f '4-' -d " "`
export SUBJECT
DESTINATION=`echo $* | cut -f '3' -d " "`
/ctm/apps/ctm_server/exe_RedHat/ctmpsm -listsysout $2 >/tmp/mailsysout_ctm.tmp
echo $* >> /tmp/mailsysout_ctm.tmp
echo $SUBJECT >> /tmp/mailsysout_ctm.tmp
echo $DESTINATION >> /tmp/mailsysout_ctm.tmp
#/bin/mailx $DESTINATION -s "$SUBJECT" </tmp>/tmp/mailsysout_ctm.log 2>&1 (this works with Solaris)
sudo -u "ctmuser" /bin/mail -s "$SUBJECT" $DESTINATION </tmp>/tmp/mailsysout_ctm.log 2>&1
echo $? >>/tmp/mailsysout_ctm.tmp


When you do a shout, in the message box must be 3 poarameter:

1. %%ORDERID
2. Email adress, when you have more than one you separate with ","
3. Subject

Exable:

%%ORDERID email-adress Abbort-SYSOUT %%JOBNAME, %APPLGROUP

You must allow the ctmuser to run mail
sudo -l
(ctmuser) NOPASSWD: /bin/mail

regards
vassilis

Janctm

Post by Janctm » 10 Aug 2012 10:26

Thanks for your reply vassi168

But i've a few questions ,because it will not work.

1 Is there a special destiionation where i must put the mail script ? eg. /home/controlm ?
2 The name of the script must have a special name ?
3 In controlm, tab Steps. What must i fill in by 'Destionation' ?

4 What is the trigger that controlm start the script ?

I hope you will answer my questions, Thanks

------------------------------------------------
i have configure now:
In controlm
On Statement *
COMPSTAT=0
Do Shout
Destionaton mail
MSG %%ORDERID <my> Abbort-SYSOUT %%JOBNAME, %APPLGROUP

On the server:
/home/controlm
-rwxr--r-- 1 controlm controlm 540 Aug 10 09:59 .mail

User avatar
th_alejandro
Nouveau
Nouveau
Posts: 188
Joined: 26 Nov 2008 12:00
Location: Bogotá

Hola Acamacru

Post by th_alejandro » 09 Nov 2012 11:57

Si te refieres a como utilizar en el desktop la creacion del mail automatico con sysout incluido, ingresa por las siguientes opciones al crear el job:

En la pestaña 'Steps', Seleccione 'On', luego donde aparece 'code' colocale NOTOK en mayuscula. 8O

Lo anterior permite definir que cuando un job genere error de ejecucion, haga algo.

Para configurar el mensaje via email, se sigue asi :

- Debajo del 'On' anterior, selecciona 'DO', en la columa TYPE selecciona MAIL, completa las demas columnas con la data requerida, correo electronico,con copia a quien, el asunto, el mensaje y, donde dice attach sysout colocale YES. :wink:


Eso es todo.

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 10 Nov 2012 11:51

Please can you explicit the ControlM version (Enterprise manager gui) ?
Thanks.

vassi168

Post by vassi168 » 15 Nov 2012 9:22

Hello Janctm,
you don't need any specific folder vor your script the only think that you need is thatyour excange admin (Outlook) to permit the user and the maschine were control_m ist running to send email.
Sorry i had forget it the first time to write.

regards
vassilis

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 16 Nov 2012 10:31

If you have the 7.0 version you can send e-mail with attachment using the do-mail option in the step panel (nothing to build).

If you has a previous version to attach the sysout, you must build program to do this and can use the do-shout or the alerts gui (GAS).

In this cas the program run on the Controlm server or Enterpres Manager server. If this are on unix SO , you can use one of the above scripts; if SO is windows you must use something different. For example a program that use "blat" utility to send e-mail.

Regards

Post Reply