Page History
...
Download (upload .json): pdmMonitoring.workflow.json
Using the Example
It is recommended to start from the example and to adjust the parameterization:
Explanation:
- A JS7 - Cycle Instruction is used in order to repeatedly perform health status checks.
- Users should adjust cycles to their monitoring needs.
- A JS7 - Retry Instruction is used in order to retry execution, for example of the MailJob included in case that e-mail cannot be sent.
- The MonitoringJob is used to perform the health status check.
- The MailJob is used to send notices and alerts by mail. This is an option, users might apply other means to forward notices and alerts.
The Cycle Instruction is configured like this:
Explanation:
- A ticking cycle is used in order to perform health status checks precisely at the given hour and minute.
- The cycle runs in hourly intervals for any day of week.
- The cycle period starts at midnight and lasts 24 hours
- This example results in 24/7 coverage with the health status check being performed every hour.
The Retry Instruction is configured like this:
Explanation:
- If any of the jobs included in the Retry Instruction fails then execution is resumed starting from the first job.
- Execution is repeated up to 3 times unless successful. The same interval of 1 minute is applied for each retry.
Using the Job Wizard for the MonitoringJob
You can use the job wizard like this:
Explanation:
- Add an empty job from the instruction panel.
- Specify a name and a label for the job.
- Select an Agent.
...
Then hit the "Next" button to make the job wizard display available arguments:
Explanation:
controller_id
: Optionally specifies the identification of the Controller to be checked. By default the current Controller is used.monitor_report_dir
: Specifies the directory to which the job will store health status report files (.json). The directory has to exist prior to running the job and has to be in reach of the Agent that runs the job.- An absolute or relative path can be specified.
- An expression can be used. The example makes use of
env('JS7_AGENT_DATA') ++ '/monitor'
which translates to use of theJS7_AGENT_DATA
environment variable created by the Agent's start script, see JS7 - Job Environment Variables. The environment variable can for example evaluate to/var/sos-berlin.com/js7/agent
. The ++ operator indicates concatenation and is followed by the name of a sub-directory. In this example the report directory will be/var/sos-berlin.com/js7/agent/monitor
.
monitor_report_max_files
: The number of report files created will be limited to this value. Older report files will be removed when this value is exceeded.from
: Specifies the e-mail address that is used to send mail for notices and alerts. The argument is used by the job to create thesubject
andbody
return variables for use with a later MailJob.- There are optional arguments for this job to identify the file carrying variables:
- if the job is used in a workflow to which orders are added from JS7 - File Watching then the job will use the internal
file
variable that specifies the incoming file and does not require an argument. - if the job is used in a workflow not subject to File Watching then the
js7_source_file
argument is used to specify the path to the file carrying variables.
- if the job is used in a workflow to which orders are added from JS7 - File Watching then the job will use the internal
- Any additional arguments specify variables that are expected from the incoming file. The example makes use of the
var1
argument which translates to the fact that from the incoming file a line is expected to specify the variable like this:var1=some value
. - Select the check box provided with each argument if you want this argument to be added to the arguments of the MonitoringJob template.
When hitting the Submit button the wizard adds the required arguments to the job which should look like this:
Using the Job Wizard for the MailJob
Find instructions from the JS7 - JITL MailJob article.
Variables
Job Resources
Return Variables
The MonitoringJob creates a number of return variables that can be used to check the
monitor_report_date
: The date and time for which the health status check has been performed. The date format isyyyy-MM-dd.HH-mm-ss.K
, for example2022-07-31.23-12-59.Z
indicating UTC time.monitor_report_file
: The path to the report file created for the health status check.subject
: The subject of an e-mail for use with a later MailJob.body
: The body of an e-mail for use with a later MailJob, by default the value is the same as for thesubject
.result
: The number of problems identified during health status check. A value 0 indicates absence of problems, other values indicate existence of problems.
Documentation
The Job Documentation including the full list of arguments can be found under: https://www.sos-berlin.com/doc/JS7-JITL/MonitoringJob.xml
...
Name | Required | Default Value | Purpose | Example | |||||
---|---|---|---|---|---|---|---|---|---|
controller_id | no | Specifies the path to the incoming file:
| /tmp/file/some_file.csv |
| yes | Specifies a variable that is expected from the incoming file:
Any number of variables can be specified like this. | Optionally specifies the identification of the Controller to be checked. By default the current Controller is used. | controller_prod | |
| yes | Specifies the directory to which the job will store health status report files (.json). The directory has to exist prior to running the job and has to be in reach of the Agent that runs the job.
|
| ||||||
monitor_report_max_files | yes | The number of report files created will be limited to this value. Older report files will be removed when this value is exceeded | 25 | ||||||
from | yes | Specifies the e-mail address that is used to send mail for notices and alerts. The argument is used by the job to create the | js7@example.com |
Further Resources
...