Details
-
Feature
-
Status: Released (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Current Situation
- If jobs are executed then this information is visible from the "History" view.
- Users have to actively check the history of task executions.
Desired Behavior
- JobUsers would like to receive a summary report of the task execution history:
- 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 "History" view in JOC Cockpit..
Implementation
- The functionality is available with the Get-JobSchedulerTaskHistory and Get-JobSchedulerOrderHistory cmdlets:
Get-JSTaskHistory Get-JSOrderHistory
- As a prerequisite the PowerShell Command Line Interface should be available for an Agent with Windows or Linux.
- The job implementation looks like this:
<job title="Report Task History" 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; # Dates in local timezone, output includes local date format Get-JSTaskHistory -Timezone (Get-Timezone ) ` | Select-Object -Property @{name="JobScheduler ID"; expression={$_.jobschedulerId}}, ` @{name="Task ID"; expression={$_.taskId}}, ` @{name="Job"; expression={$_.job}}, ` @{name="Status"; expression={$_.state._text}}, ` @{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 }}, ` @{name="Criticality"; expression={$_.criticality}}, ` @{name="Exit Code"; expression={$_.exitCode}} ` ]]></script> <run_time/> </job>
- For notification
- the report can be stored to an Excel file, see PowerShell CLI 1.2 - Use Cases - Task History Report
- the report can be forwarded by mail, see PowerShell CLI 1.2 - Use Cases - Report Automation
Maintainer Notes
- The PowerShell module ships independently from JobScheduler releases and offers the functionality starting from release 1.2.1, see https://github.com/sos-berlin/scheduler-cli-powershell
Attachments
Issue Links
- Wiki Page
-
Wiki Page Loading...