MEXICO -- HELP OM SENDING eMAILS USING DO MAIL
MEXICO -- HELP OM SENDING eMAILS USING DO MAIL
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
I am tryig since the job definition interfase...
I want to send an email with the sysout as an atachmente
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.
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.
How to save %%ORDERID and %%JOBNAME via DO Set-Var
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
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
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
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
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
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
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
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
- th_alejandro
- Nouveau
- Posts: 188
- Joined: 26 Nov 2008 12:00
- Location: Bogotá
Hola Acamacru
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.
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.
Eso es todo.
En la pestaña 'Steps', Seleccione 'On', luego donde aparece 'code' colocale NOTOK en mayuscula.
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.
Eso es todo.
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
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