Introduction

When a Backup JobScheduler instance in a JobScheduler Backup cluster takes over, it could be usefull that someone will be informed about this. Here comes a simple approach how to achieve this.

JobScheduler Clusters. Sending email on take over

The idea is to make a job that starts once on JobScheduler start and sends an e-mail on certain conditions. One condition in a backup cluster could be the host name of the server that the Backup JobScheduler is operated for.

Here is the configurationfor this kind of job:

 <job  title="Send Mails" order="no" name="CheckStart">
     <description >
         <include  file="jobs/JobSchedulerManagedMailJob.xml"/>
     </description>
 
     <params >
         <param  name="to" value="admin@company.com"/>
         <param  name="subject" value="Job Scheduler has been startet."/>
         <param  name="host" value="smtp.server"/>
         <param  name="body" value="Job Scheduler has been startet"/>
     </params>
 
     <script  language="java" java_class="sos.scheduler.managed.JobSchedulerManagedMailJob"/>
 
     <monitor  name="check" ordering="0">
         <script  language="java:javascript">
             <![CDATA[
 function spooler_process_before() {
     spooler_log.info(spooler.hostname);
     return (spooler.hostname == "js_backup");
 }
              ]]>
         </script>
     </monitor>
 
     <run_time  once="yes"/>
 </job>