Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Conversion corrections

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

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="&lt;html&gt;<html>   &lt;head&gt;<head>      &lt;meta<meta http-equiv=&quot;"content-type&quot;" content=&quot;"text/html; charset=ISO-8859-15&quot;&gt;">     &lt;title&gt;&lt;/title&gt;<title></title>   &lt;/head&gt;</head>   &lt;body<body text=&quot;#000000&quot;"#000000" bgcolor=&quot;#FFFFFF&quot;&gt;"#FFFFFF">     &lt;b&gt;Scheduler<b>Scheduler ID:&lt;/b&gt;</b> &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     %\{SCHEDULER_ID\}&lt;br&gt;}<br>     &lt;b&gt;Scheduler&lt;/b&gt;:&amp;<b>Scheduler</b>:&nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     %\{SCHEDULER_HOST\}:%\{SCHEDULER_TCP_PORT\}&lt;br&gt;}<br>     &lt;b&gt;Configuration<b>Configuration in:&lt;/b&gt;</b> &amp;nbsp;&amp;nbsp;&amp;nbsp;     %\{SCHEDULER_CONFIGURATION_DIRECTORY\}&lt;br&gt;}<br>     &lt;br&gt;<br>     &lt;b&gt;Task:&lt;/b&gt; %\<b>Task:</b> %{SCHEDULER_TASK_ID\}&lt;br&gt;}<br>     &lt;b&gt;Job<b>Job: &amp;nbsp; &lt;/b&gt;%\</b>%{SCHEDULER_JOB_NAME\}&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;<br>     %\{SCHEDULER_JOB_TITLE\}&lt;br&gt;}<br>     &lt;br&gt;<br>     &lt;b&gt;Job<b>Job_chain:&lt;/b&gt;&amp;</b>&nbsp; %\{SCHEDULER_JOB_CHAIN_NAME\}&lt;br&gt;}<br>     %\{SCHEDULER_JOB_CHAIN_TITLE\}&lt;br&gt;}<br>     &lt;br&gt;<br>     &lt;b&gt;Order&lt;/b&gt;:&amp;<b>Order</b>:&nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     &amp;nbsp;&amp;nbsp;&amp;nbsp; %\{SCHEDULER_ORDER_ID\}&lt;br&gt;}<br>     &lt;b&gt;in<b>in Node:&lt;/b&gt;&amp;</b>&nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     %\{SCHEDULER_NODE_NAME\}&lt;br&gt;}<br>     &lt;b&gt;next<b>next Node:&lt;/b&gt;</b> &amp;nbsp;&amp;nbsp;&amp;nbsp; %\{SCHEDULER_NEXT_NODE_NAME\}&lt;br&gt;}<br>     &lt;br&gt;<br>     &lt;font<font color=&quot;#999999&quot;"#999999" face=&quot;Calibri&quot;&gt;&lt;small&gt;&lt;small&gt;&lt;font"Calibri"><small><small><font size=&quot;-1&quot;&gt;&lt;small&gt;&lt;small&gt;&lt;/small&gt;&lt;/small&gt;&lt;/font&gt;&lt;/small&gt;&lt;/small&gt;&lt;/font&gt;"-1"><small><small></small></small></font></small></small></font>     &lt;div<div class=&quot;"moz-signature&quot;&gt; &lt;/div&gt;"> </div>   &lt;/body&gt; &lt;/html&gt;</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="&lt;html&gt;<html>   &lt;head&gt;<head>      &lt;meta<meta http-equiv=&quot;"content-type&quot;" content=&quot;"text/html; charset=ISO-8859-15&quot;&gt;">      &lt;title&gt;&lt;/title&gt;<title></title>   &lt;/head&gt;</head>   &lt;body<body text=&quot;#000000&quot;"#000000" bgcolor=&quot;#FFFFFF&quot;&gt;"#FFFFFF">     &lt;b&gt;Scheduler<b>Scheduler ID:&lt;/b&gt;</b> &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     %\{SCHEDULER_ID\}&lt;br&gt;}<br>     &lt;b&gt;Scheduler&lt;/b&gt;:&amp;<b>Scheduler</b>:&nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     %\{SCHEDULER_HOST\}:%\{SCHEDULER_TCP_PORT\}&lt;br&gt;}<br>     &lt;b&gt;Configuration<b>Configuration in:&lt;/b&gt;</b> &amp;nbsp;&amp;nbsp;&amp;nbsp;     %\{SCHEDULER_CONFIGURATION_DIRECTORY\}&lt;br&gt;}<br>     &lt;br&gt;<br>     &lt;b&gt;Task:&lt;/b&gt; %\<b>Task:</b> %{SCHEDULER_TASK_ID\}&lt;br&gt;}<br>     &lt;b&gt;Job<b>Job: &amp;nbsp; &lt;/b&gt;%\</b>%{SCHEDULER_JOB_NAME\}&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;<br>     %\{SCHEDULER_JOB_TITLE\}&lt;br&gt;}<br>     &lt;br&gt;<br>     &lt;b&gt;Job<b>Job_chain:&lt;/b&gt;&amp;</b>&nbsp; %\{SCHEDULER_JOB_CHAIN_NAME\}&lt;br&gt;}<br>     %\{SCHEDULER_JOB_CHAIN_TITLE\}&lt;br&gt;}<br>     &lt;br&gt;<br>     &lt;b&gt;Order&lt;/b&gt;:&amp;<b>Order</b>:&nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     &amp;nbsp;&amp;nbsp;&amp;nbsp; %\{SCHEDULER_ORDER_ID\}&lt;br&gt;}<br>     &lt;b&gt;in<b>in Node:&lt;/b&gt;&amp;</b>&nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     %\{SCHEDULER_NODE_NAME\}&lt;br&gt;}<br>     &lt;b&gt;next<b>next Node:&lt;/b&gt;</b> &amp;nbsp;&amp;nbsp;&amp;nbsp; %\{SCHEDULER_NEXT_NODE_NAME\}&lt;br&gt;}<br>     &lt;br&gt;<br>     &lt;font<font color=&quot;#999999&quot;"#999999" face=&quot;Calibri&quot;&gt;&lt;small&gt;&lt;small&gt;&lt;font"Calibri"><small><small><font size=&quot;-1&quot;&gt;&lt;small&gt;&lt;small&gt;&lt;/small&gt;&lt;/small&gt;&lt;/font&gt;&lt;/small&gt;&lt;/small&gt;&lt;/font&gt;"-1"><small><small></small></small></font></small></small></font>     &lt;div<div class=&quot;"moz-signature&quot;&gt; &lt;/div&gt;"> </div>   &lt;/body&gt; &lt;/html&gt;</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>