Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
you can define a monitor for a specific job which sends emails in case of
- error
success - job start
Please add the monitor as a pre/postprocessing to the job. The language is java and the class is com.sos.jitl.mail.smtp.SmtpMailMonitor
...
An example job configuration with a html body
Code Block |
---|
<job title="Dies ist der Titel des Jobs" stop_on_error="no" order="yes" name="email_monitor"> <settings > <log_level ><![CDATA[debug9]]></log_level> </settings> <params > <param name="host" value="smtp.sos"/> <param name="port" value="25"/> <param name="from" value="scheduler@ur"/> <param name="MailOnJobStart_to" value="uwe.risse@sos-berlin.com"/> <param name="MailOnJobStart_subject" value="Job: %\{SCHEDULER_JOB_NAME\} Task: %\{SCHEDULER_TASK_ID\}"/> <param name="MailOnJobStart_body" value="<html><html> <head><head> <meta<meta http-equiv=""content-type"" content=""text/html; charset=ISO-8859-15">"> <title></title><title></title> </head></head> <body<body text="#000000""#000000" bgcolor="#FFFFFF">"#FFFFFF"> <b>Scheduler<b>Scheduler ID:</b></b> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; %\{SCHEDULER_ID\}<br>}<br> <b>Scheduler</b>:&<b>Scheduler</b>: &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %\{SCHEDULER_HOST\}:%\{SCHEDULER_TCP_PORT\}<br>}<br> <b>Configuration<b>Configuration in:</b></b> &nbsp;&nbsp;&nbsp; %\{SCHEDULER_CONFIGURATION_DIRECTORY\}<br>}<br> <br><br> <b>Task:</b> %\<b>Task:</b> %{SCHEDULER_TASK_ID\}<br>}<br> <b>Job<b>Job: &nbsp; </b>%\</b>%{SCHEDULER_JOB_NAME\}&nbsp; &nbsp;&nbsp;&nbsp; <br><br> %\{SCHEDULER_JOB_TITLE\}<br>}<br> <br><br> <b>Job<b>Job_chain:</b>&</b> %\{SCHEDULER_JOB_CHAIN_NAME\}<br>}<br> %\{SCHEDULER_JOB_CHAIN_TITLE\}<br>}<br> <br><br> <b>Order</b>:&<b>Order</b>: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; %\{SCHEDULER_ORDER_ID\}<br>}<br> <b>in<b>in Node:</b>&</b> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; %\{SCHEDULER_NODE_NAME\}<br>}<br> <b>next<b>next Node:</b></b> &nbsp;&nbsp;&nbsp; %\{SCHEDULER_NEXT_NODE_NAME\}<br>}<br> <br><br> <font<font color="#999999""#999999" face="Calibri"><small><small><font"Calibri"><small><small><font size="-1"><small><small></small></small></font></small></small></font>"-1"><small><small></small></small></font></small></small></font> <div<div class=""moz-signature"> </div>"> </div> </body> </html></body> </html> "/> <param name="MailOnJobStart_content_type" value="text/html"/> <param name="MailOnError_to" value="uwe.risse@sos-berlin.com"/> <param name="MailOnError_subject" value="An error occurred in Job: %\{SCHEDULER_JOB_NAME\} Task: %\{SCHEDULER_TASK_ID\}"/> <param name="MailOnError_content_type" value="text/html"/> <param name="MailOnError_body" value="<html><html> <head><head> <meta<meta http-equiv=""content-type"" content=""text/html; charset=ISO-8859-15">"> <title></title><title></title> </head></head> <body<body text="#000000""#000000" bgcolor="#FFFFFF">"#FFFFFF"> <b>Scheduler<b>Scheduler ID:</b></b> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; %\{SCHEDULER_ID\}<br>}<br> <b>Scheduler</b>:&<b>Scheduler</b>: &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %\{SCHEDULER_HOST\}:%\{SCHEDULER_TCP_PORT\}<br>}<br> <b>Configuration<b>Configuration in:</b></b> &nbsp;&nbsp;&nbsp; %\{SCHEDULER_CONFIGURATION_DIRECTORY\}<br>}<br> <br><br> <b>Task:</b> %\<b>Task:</b> %{SCHEDULER_TASK_ID\}<br>}<br> <b>Job<b>Job: &nbsp; </b>%\</b>%{SCHEDULER_JOB_NAME\}&nbsp; &nbsp;&nbsp;&nbsp; <br><br> %\{SCHEDULER_JOB_TITLE\}<br>}<br> <br><br> <b>Job<b>Job_chain:</b>&</b> %\{SCHEDULER_JOB_CHAIN_NAME\}<br>}<br> %\{SCHEDULER_JOB_CHAIN_TITLE\}<br>}<br> <br><br> <b>Order</b>:&<b>Order</b>: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; %\{SCHEDULER_ORDER_ID\}<br>}<br> <b>in<b>in Node:</b>&</b> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; %\{SCHEDULER_NODE_NAME\}<br>}<br> <b>next<b>next Node:</b></b> &nbsp;&nbsp;&nbsp; %\{SCHEDULER_NEXT_NODE_NAME\}<br>}<br> <br><br> <font<font color="#999999""#999999" face="Calibri"><small><small><font"Calibri"><small><small><font size="-1"><small><small></small></small></font></small></small></font>"-1"><small><small></small></small></font></small></small></font> <div<div class=""moz-signature"> </div>"> </div> </body> </html></body> </html> "/> </params> <script language="shell"> <![CDATA[ dir exit 1 ]]> </script> <monitor name="process0" ordering="0"> <script language="java" java_class="com.sos.jitl.mail.smtp.SmtpMailMonitor"/> </monitor> <run_time /> </job> |