Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1889

Notify if jobs have not been executed or if jobs are late

    XMLWordPrintable

Details

    Description

      Current Situation

      • If jobs are not executed at the planned point in time or if they are late being executed then this information is visible from the "Daily Plan" view.
      • Users have to actively check the daily plan for late jobs.

      Desired Behavior

      • JobScheduler should send a notification about late jobs:
        • a job should be available that can be scheduled for repeated execution during the day.
        • the information included with the job output corresponds to what is visible from the "Daily Plan" view in JOC Cockpit.

      Implementation

      • The job implementation looks like this:
        • <job title="Report Daily Plan late jobs" process_class="agent_windows">
            <script language="powershell"><![CDATA[
          Import-Module $env:SCHEDULER_DATA/config/powershell/Modules/JobScheduler;
          
          Connect-JS -Url $JOCCockpitUrl -Credential $JOCCockpitCredential | Out-Null;
          
          # start mode mapping
          $startModes = @{"0"="single start"; "1"="repeat start-start"; "2"="repeat end-start"};
          
          # Dates in local time zone, output includes local date format
          Get-JSDailyPlan -Late -Timezone (Get-Timezone) `
                          |  Select-Object -Property @{name="Job Chain/Job"; expression={ "$($_.jobChain)$($_.job)"}}, `
                                                     @{name="Order ID"; expression={$_.orderId}}, `
                                                     @{name="Status"; expression={$_.state._text}}, `
                                                     @{name="Job Stream"; expression={$_.jobStream}}, `
                                                     @{name="Late"; expression={$_.late}}, `
                                                     @{name="Start Type"; expression={ $startModes[ "$($_.startMode)"] }}, `
                                                     @{name="Repeat Interval"; expression={$_.period.repeat}}, `
                                                     @{name="Planned Start Time"; expression={ Get-Date $_.plannedStartTime }}, `
                                                     @{name="Expected End Time"; expression={ Get-Date $_.expectedEndTime }}, `
                                                     @{name="Expected Duration (sec.)"; expression={ (New-Timespan -Start "$($_.plannedStartTime)" -End "$($_.expectedEndTime)").Seconds }}, `
                                                     @{name="Start Time"; expression={ Get-Date $_.startTime }}, `
                                                     @{name="End Time"; expression={ Get-Date $_.endTime }}, `
                                                     @{name="Duration (sec.)"; expression={ (New-Timespan -Start "$($_.startTime)" -End "$($_.endTime)").Seconds }}
          ]]></script>
            <run_time/>
          </job>
          

      Maintainer Notes

      Attachments

        Issue Links

          Activity

            People

              ap Andreas Püschel
              ap Andreas Püschel
              Kanika Agrawal Kanika Agrawal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: