Introduction
This article describes individual configuration parameters and provides examples of their use with monitors such as op5 and Zabbix and using of the mail und JMS interfaces.
Download: notification.xml
Send notifications
Notify on error
is configured.SystemMonitorNotification / Notification /
NotificationMonitor / @service_name_on_error
SystemMonitorNotification / Notification / NotificationObjects / JobChain
Error messages
- will be sent:
- when at the time of the sos / notification / SystemNotifier run, an order is in a job chain state(step) that has ended with an error
- will not be sent:
- when after the last run of the sos / notification / SystemNotifier, an error has occured in an job chain state(step) but at the time of the current sos / notification / SystemNotifier run this order is in an other/next job chain state(step)
- this kind of error is ignored because the order has continued to run
- when an error has reoccurred in the same job chain state(step) where a notification has already been sent
- when the first step of the specific order has been removed from the notification tables by sos / notification / CleanupNotifications
- when a notification maximum has been reached
- when a job chain state(step) has been configured as excluded
- when the
@step_from
or@step_to
settings have been configured and the job chain state(step) is out of the configured range - when the
@return_code_from
or@return_code_to
settings have been configured and the return code of the job chain state(step) is out of the configured range
- when after the last run of the sos / notification / SystemNotifier, an error has occured in an job chain state(step) but at the time of the current sos / notification / SystemNotifier run this order is in an other/next job chain state(step)
Recovery messages
- will be automatically sent using the same service name and message as the relevant error message:
- when the error message of a job chain state(step) has already been sent and the order at the time of the current sos / notification / SystemNotifier run is in an other/next state(step)
- e.g. the rerun of the error state(step) has been successfull and the order has been moved to the next job chain state(step)
- Note: use
${SERVICE_STATUS}
and${SERVICE_MESSAGE_PREFIX}
variables to differentiate between recovery and error message
- when the error message of a job chain state(step) has already been sent and the order at the time of the current sos / notification / SystemNotifier run is in an other/next state(step)
- will not be sent:
- when a job chain state(step) has recovered after the last run of the sos / notification / SystemNotifier but at the time of the current sos / notification / SystemNotifier run a new error in the other/next step has occured
SystemMonitorNotification / Notification / NotificationObjects / Job
Error messages
- will be sent:
- when a job chain state(step) or standalone job (JobScheduler versions from 1.12) ends with an error
- will not be sent:
- when a notification maximum has been reached
- when the
@return_code_from
or@return_code_to
settings have been configured and the return code of the job is out of the configured range
Notify on success
is configured.SystemMonitorNotification / Notification /
NotificationMonitor / @service_name_on_success
SystemMonitorNotification / Notification / NotificationObjects / JobChain
Success messages
- will be sent:
- when an order is completed and the last job chain state(step) has no error
- will not be sent:
- when a notification maximum has been reached
- when the
@return_code_from
or@return_code_to
settings have been configured and the return code of the job chain state(step) is out of the configured range
SystemMonitorNotification / Notification / NotificationObjects / Job
Success messages
- will be sent:
- when a job chain state(step) or standalone job (JobScheduler releases from 1.12) ends without error
- will not be sent:
- when a notification maximum has been reached
- when the
@return_code_from
or@return_code_to
settings have been configured and the return code of the job is out of the configured range
Configuration Editor
We recommend that the XML Editor is used generate monitoring configuration objects. This editor automatically uses an XSD Schema
to generate configuration suggestions and validate configurations, and its use is intended to provide a significant reduction in the time required to develop and test a configuration.
XSD Schema locations
- https://www.sos-berlin.com/schema/jobscheduler/SystemMonitorNotification_v1.0.xsd
- JobScheduler releases before 1.13.1
<scheduler_data>/config/notification
/SystemMonitorNotification_v1.0.xsd
- JobScheduler releases starting from 1.13.1
<scheduler_data>/config/live/sos/.configuration/notification/SystemMonitorNotification_v1.0.xsd
Configuration
JobScheduler
Activation of Monitoring Interface
- JobScheduler releases before 1.11
- JobScheduler releases starting from 1.11
- Set param
sos.use_notification true (config/scheduler.xml)
- see JobScheduler - Job Chains
- Set param
Note:
- JobScheduler releases before 1.13.1
file(s) (see below) must be configured before activtion.SystemMonitorNotification_<MonitorSystem>.xml
- JobScheduler releases starting from 1.13.1
SystemMonitorNotification_<MonitorSystem>.xml
file(s) (see below) must be configured before activtion or- The NOTIFICATION configuration was forwarded by the Joc Cockpit to the respective JobScheduler Master.
SystemMonitorNotification files
JobScheduler releases before 1.13.1
Location: <scheduler_data>/config/notification
File | Description |
---|---|
SystemMonitorNotification_v1.0.xsd | The XML Schema file defines which values are allowed in your XML files for the JobScheduler monitoring. That means that to configure the JobScheduler objects you want to monitor and the System Monitor you just have to modify your |
SystemMonitorNotification_<MonitorSystem>.xml | Configuration file for each System Monitor.
|
| Configuration file for all System Monitors.
This file is optional and contains the definitions of the |
JobScheduler releases starting from 1.13.1
Note: Usage of the configuration files in the <scheduler_data>/config/notification
folder has been deprecated.
Location: <scheduler_data>/config/live/sos/.configuration/notification
File | Description |
---|---|
SystemMonitorNotification_v1.0.xsd | The XML Schema file defines which values are allowed in your XML files for the JobScheduler monitoring. |
notification.xml | Configuration file for System Monitors:
|
SystemMonitorNotification Elements
The configuration element descriptions are organized into the following major categories:
Element | Element description | Description |
---|---|---|
SystemMonitorNotification | Top Level Element | Configuration for notifications to be sent to a system monitor. |
Notification | Required, multiple use allowed inside the SystemMonitorNotification element | Specifies a system monitor notification that includes a command line invocation and the JobScheduler objects. |
Timer | Optional or multiple use allowed inside the SystemMonitorNotification element | Performance measurement definition. |
SystemMonitorNotification
- JITL-230Getting issue details... STATUS
SystemMonitorNotification
supports the following attributes:
Attribute | JobScheduler release | Usage | Description |
---|---|---|---|
system_id | before 1.13.1 | required | System Monitor identifier. See JobScheduler - Job Chains customization Note:
|
starting from 1.13.1 | required |
|
SystemMonitorNotification / Notification
Notification
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
name | optional | Notification description |
The following elements may be nested inside a Notification
element:
Element | Element description | Description |
---|---|---|
NotificationMonitor | Required, only once inside the Notification element | Specifies the System Monitor interface that is being used for messages: either by a Plug-in Interface or by command line invocation |
NotificationObjects | Required, only once inside the Notification element | Specifies the Job Chain and the Timer definitions |
SystemMonitorNotification / Notification / NotificationMonitor
The JobScheduler Interface Monitor can be used to monitor the messages for the 3 use cases:
- error case
- an error has occurred / been recovered during a job chain / job execution
- the
service_name_on_error
setting is responsible for this monitoring case
- the
- an error has occurred / been recovered during a job chain / job execution
- success case
- a job chain / job ends successfully
- the
service_name_on_success
setting is responsible for this monitoring case
- the
- a job chain / job ends successfully
- performance check (see
Timer
)- usually the
service_name_on_error
setting is responsible for this monitoring case but the performance check will also work if only theservice_name_on_success
setting has been defined.
- usually the
In addition, the service_name_on_error
/ service_name_on_success
attributes have the following meaning:
NotificationInterface
- The setting must match the corresponding service name in the System Monitor such as Nagios or op5.
NotificationCommand
- Freely selectable, has no further meaning than to identify a notification.
NotificationMail
- Freely selectable, has no further meaning than to identify a notification.
NotificationJMS
- The setting must match the corresponding queue/topic name in the JMS Server.
Note:
- attributes
service_name_on_error
andservice_name_on_success
- at least one of these attributes must be configured
- both attributes can be configured together
- the use of this settings must be unique within one SystemNotification
NotificationMonitor
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
service_name_on_error | Optional | See explanation above. |
service_name_on_success | Optional | See explanation above. |
service_status_on_error | Optional | This setting specifies the service status code for error messages. Default: |
service_status_on_success | Optional | This setting specifies the service status code for success messages Default: |
One of the following elements must be nested inside a NotificationMonitor
element:
Element | Element description | Description |
---|---|---|
NotificationInterface | Optional or only once inside the NotificationMonitor element | NSCA plug-in Interface to be executed for System Monitor notification |
NotificationCommand | Optional or only once inside the NotificationMonitor element | Command line to be executed for System Monitor notification |
NotificationMail | Optional or only once inside the NotificationMonitor element | Mail interface to be executed for System Monitor notification |
NotificationJMS | Optional or only once inside the NotificationMonitor element | JMS interface to be executed for System Monitor notification |
SystemMonitorNotification / Notification / NotificationMonitor / NotificationInterface
NSCA plug-in Interface to be executed for System Monitor notification.
NotificationInterface
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
monitor_host | Required | This setting specifies the host name or IP address of the System Monitor host. |
monitor_port | Required | This setting specifies the TCP port that the System Monitor will listen to. |
monitor_password | Optional | This setting specifies the password
|
monitor_connection_timeout | Optional | This setting specifies the connection timeout in ms. Default: |
monitor_response_timeout | Optional | This setting specifies the response timeout in ms. |
monitor_encryption | Optional | This setting specifies that the communication with the System Monitor is encrypted. By default no encryption is used.
|
service_host | Required | This setting specifies the name of the host that executes the passive check. The name must match the corresponding setting in the System Monitor. |
plugin | Optional | Default:
|
System Monitor: Opsview
In case you are using OpsView as the monitoring tool, the plugin used in NotificationInterface
will not work, since OpsView supports 20 types of encryption, which are not supported by this plugin. You can use it only in case that no encryption is used (type: NONE) .
Instead, you should use the XML element NotificationCommand
and indicate the exact command to send passive checks to an OpsView server from a remote machine (see example for op5 or example for zabbix).
SystemMonitorNotification / Notification / NotificationMonitor / NotificationCommand
Command line to be executed for System Monitor notification.
NotificationCommand
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
plugin | Optional | Default:
|
SystemMonitorNotification / Notification / NotificationMonitor / NotificationMail
- JS-1388Getting issue details... STATUS
The Mail interface to be executed for System Monitor notification.
The Mail interface reads the following values from the configuration files:
config/factory.ini
- Section
spooler
log_mail_from
log_mail_to
log_mail_cc
log_mail_bcc
smtp
mail_queue_dir
mail_queue_only
- Section
smtp
mail.smtp.user
mail.smtp.password
mail.smtp.port
mail.smtp.connectiontimeout
mail.smtp.timeout
- Section
config/private/private.conf
joc.url
NotificationMail
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
content_type | Optional | Content type of the e-mail. Possible values:
Default: |
charset | Optional | Charset of the e-mail. Default: |
encoding | Optional | Encoding of the e-mail. Possible values:
Default: |
priority | Optional | Priority of the e-mail. Possible values:
Default: |
plugin | Optional | Java class of the plugin implementation (extends Default: |
The following elements can be nested inside a NotificationMail
element:
Element | Element description | Description |
---|---|---|
From | Optional or only once inside of the NotificationMail element | E-mail address of the account that sends e-mail. |
To | Optional or only once inside of the element | E-mail address of the recipient(s) of a notification e-mail. |
CC | Optional or only once inside of the NotificationMail element | E-mail address of the recipient(s) of a carbon copy notification e-mail. |
BCC | Optional or only once inside of the NotificationMail element | E-mail address of recipient(s) of a blind carbon copy notification e-mail. |
Subject | Required, only once inside of the NotificationMail element | Subject of an e-mail notification. |
Body | Required, only once inside of the NotificationMail element | Body of an e-mail notification. |
SystemMonitorNotification / Notification / NotificationMonitor / NotificationMail / From
E-mail address of the account that sends the e-mail.
The mail notification interface uses the value of the log_mail_from
entry (configuration file config/factory.ini
) when this element is not set.
SystemMonitorNotification / Notification / NotificationMonitor / NotificationMail / To
E-mail address of the recipient(s) of a notification e-mail.
When this element
- is not set
will be usedlog_mail_to
- is set
-
log_mail_to
, log_mail_cc, log_mail_bcc
are not used
-
SystemMonitorNotification / Notification / NotificationMonitor / NotificationMail / CC
E-mail address of the recipient(s) of a carbon copy notification e-mail.
When this element
- is not set
will be used (if thelog_mail_cc
NotificationMail/To
element is not defined - see above)
- is set
-
log_mail_cc, log_mail_bcc
are not used
-
SystemMonitorNotification / Notification / NotificationMonitor / NotificationMail / BCC
E-mail address of recipient(s) of a blind carbon copy notification e-mail.
When this element
- is not set
will be used (if thelog_mail_bcc
NotificationMail/To
orNotificationMail/CC
elements are not defined - see above)
- is set
-
log_mail_bcc
are not used
-
SystemMonitorNotification / Notification / NotificationMonitor / NotificationMail / Subject
Subject of an e-mail notification.
The Subject
can contain the JobScheduler Monitoring Interface variables.
SystemMonitorNotification / Notification / NotificationMonitor / NotificationMail / Body
Body of an e-mail notification.
The Body
can contain the JobScheduler Monitoring Interface variables.
SystemMonitorNotification / Notification / NotificationMonitor / NotificationJMS
- JITL-280Getting issue details... STATUS
JMS Interface to be executed for System Monitor notification.
Note: the provider-specific queue
or topic name
will be defined with the service_name_on_error
/ service_status_on_succes
attribute of the parent SystemMonitorNotification / Notification / NotificationMonitor
element.
NotificationJMS
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
client_id | Optional | The client identifier for this connection. |
destination | Optional | A Possible values:
See: Destination Default: |
acknowledge_mode | Optional | Session acknowledgment mode. Possible values:
See: Session Default: |
delivery_mode | Optional | Delivery mode. Possible values:
See: Default: |
priority | Optional | The producer's default priority. See: MessageProducer.setPriority Default: |
time_to_live | Optional | Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system. See: MessageProducer.setTimeToLive Possible values:
Default: |
plugin | Optional | Java class of the plugin implementation (extends Default: |
One of the following elements must be nested inside a NotificationJMS
element:
Element | Element description | Description |
---|---|---|
ConnectionFactory | Optional or only once inside the NotificationJMS element | Specifies use of a JMS ConnectionFactory implementation |
ConnectionJNDI | Optional or only once inside the NotificationJMS element | Specifies use of a JNDI properties file to create a JNDI IntialContextFactory |
JMS message:
Element | Element description | Description |
---|---|---|
Message | Required, only once inside of NotificationJMS element | Body of a JMS notification |
SystemMonitorNotification / Notification / NotificationMonitor / NotificationJMS / ConnectionFactory
Specifies use of a JMS ConnectionFactory implementation.
ConnectionFactory
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
java_class | Required | Java class of the JMS ConnectionFactory e.g.: |
user_name | Optional | The caller's user name |
password | Optional | The caller's password |
The following element can be nested inside a ConnectionFactory
element:
Element | Element description | Description |
---|---|---|
ConstructorArguments | Optional or only once inside of ConnectionFactory element |
SystemMonitorNotification / Notification / NotificationMonitor / NotificationJMS / ConnectionFactory / ConstructorArguments
The following elements can be nested inside a ConstructorArguments
element:
Element | Element description | Description |
---|---|---|
Argument | Required, multiple use allowed inside the ConstructorArguments element | JMS ConnectionFactory constructor argument |
SystemMonitorNotification / Notification / NotificationMonitor / NotificationJMS / ConnectionFactory / ConstructorArguments / Argument
Argument
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
type | Required | Java type of a constructor argument. Possible values:
Default: |
The value of the constructor argument will be stored as CDATA
node.
SystemMonitorNotification / Notification / NotificationMonitor / NotificationJMS / ConnectionJNDI
Specifies use of a JNDI properties file to create a JNDI IntialContextFactory.
See: Connecting to the JMS Server by Using JNDI
ConnectionJNDI
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
file | Required | Path of the JNDI properties file |
lookup_name | Optional | Name to lookup JMS connection factory objects Default: |
SystemMonitorNotification / Notification / NotificationMonitor / NotificationJMS / Message
Body of a JMS notification.
SystemMonitorNotification / Notification / NotificationObjects
One of the following elements must be nested inside a NotificationObjects
element:
Element | Element description | Description |
---|---|---|
Job | Optional or multiple use allowed inside the NotificationObjects element | Restricts notifications for order or standalone jobs |
JobChain | Optional or multiple use allowed inside the NotificationObjects element | Restricts notifications for job chains |
TimerRef | Optional or multiple use allowed inside the NotificationObjects element | Restricts notifications for performance checks (Timer) |
MasterMessage | Optional or only once inside the NotificationObjects element | |
TaskWarning | Optional or only once inside the NotificationObjects element | |
TaskIfLongerThan | Optional or only once inside the NotificationObjects element | |
TaskIfShorterThan | Optional or only once inside the NotificationObjects element |
SystemMonitorNotification / Notification / NotificationObjects / Job
This element specifies the order-controlled
or
jobs for which notifications are being sent to a system monitor.standalone
Support for standalone
jobs starting with
-
JITL-400Getting issue details...
STATUS
.
Job
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
notifications | Optional Integer | Specifies the number of transfers the same notification to a System Monitor. Default: |
scheduler_id | Optional | Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that log into the same database. Regular expression can be used. |
name | Optional | |
return_code_from | Optional | Restricts notifications for jobs for a particular return code range. |
return_code_from | Optional | Restricts notifications for jobs for a particular return code range. |
SystemMonitorNotification / Notification / NotificationObjects / JobChain
Specifies the job chains for which notifications are being sent to a system monitor.
The element can be repeatedly used to specifiy a number of job chains.
Default behaviour for repeatedly failed job chain steps: when an error reoccurrs in the same job node for which a notification has already been sent then this order state is considered being previously notified and no new notification will be sent.
See child element NotifyRepeatedError
.
JobChain
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
notifications | Optional Integer | Specifies the number of transfers the same notification to a System Monitor. Default: |
scheduler_id | Optional | Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that log into the same database. Regular expression can be used. |
name | Optional | |
return_code_from | Optional | Restricts notifications for job chains for a particular return code range. |
return_code_from | Optional | Restricts notifications for job chains for a particular return code range. |
step_from | Optional | Restricts notifications for job chains to a sequence of job nodes that are specified with the step_from and step_to attributes. |
step_to | Optional | Restricts notifications for job chains to a sequence of job nodes that are specified with the step_from and step_to attributes. |
excluded_steps | Optional | Specifies the steps which will be excluded from the analyzing (separated by semicolon) |
The following element can be nested inside a JobChain
element:
Element | Element description | Description |
---|---|---|
NotifyRepeatedError | Optional or only once inside the JobChain element | Send notifications for all errors that occur, do not suppress errors for repeatedly failed executions. |
SystemMonitorNotification / Notification / NotificationObjects / JobChain / NotifyRepeatedError
- JITL-534Getting issue details... STATUS
Send notifications for all errors that occur, do not suppress errors for repeatedly failed executions.
One of the following elements can be nested inside a NotifyRepeatedError
element:
Element | Element description | Description |
---|---|---|
NotifyByIntervention | Optional or only once inside the NotifyRepeatedError element | Send notifications for errors that occur due to repeated failed executions if the restart was caused by manual intervention. |
NotifyByPeriod | Optional or only once inside the NotifyRepeatedError element | Send notifications for errors that occur due to repeatedly failed executions if a configurable period of time is exceeded. |
SystemMonitorNotification / Notification / NotificationObjects / JobChain / NotifyRepeatedError / NotifyByIntervention
Send notifications for errors that occur due to repeated failed executions if the restart was caused by manual intervention.
SystemMonitorNotification / Notification / NotificationObjects / JobChain / NotifyRepeatedError / NotifyByPeriod
Send notifications for errors that occur due to repeatedly failed executions if a configurable period of time is exceeded.
NotifyByPeriod
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
period | Required | The period between notifications is calculated from the time of the last failed execution for which a notification has been sent and the time of the current failed execution. Possible values:
|
SystemMonitorNotification / Notification / NotificationObjects / TimerRef
TimerRef
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
notifications | Optional Integer | Specifies the number of transfers the same notification to a System Monitor. Default: |
ref | Required | Corresponds with Timer name setting defined in the SystemMonitorNotification / Timer element |
notify_on_error | Optional Boolean | Send timer check notification when the configured job chain contains the error notifications. Default: |
SystemMonitorNotification / Notification / NotificationObjects / MasterMessage
- JS-1837Getting issue details... STATUS
MasterMessage
includes problems detected by a JobScheduler Master, e.g. database connection lost.
Requirements:
-
./config/factory.ini
configuration file:mail_queue_only=true
mail_queue_dir
setting specifies a directory to store the JobScheduler mailsmail_on_warning=true
mail_on_error=true
MasterMessage
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
scheduler_id | Optional | Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that log into the same database. Regular expression can be used. |
| Optional Integer | Specifies the number of transfers the same notification to a System Monitor. Default: |
SystemMonitorNotification / Notification / NotificationObjects / TaskWarning
- JS-1837Getting issue details... STATUS
TaskWarning
includes job execution warning messages.
Requirements:
-
./config/factory.ini
configuration file:mail_queue_only=true
mail_queue_dir
setting specifies a directory to store the JobScheduler mailsmail_on_warning=true
TaskWarning
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
scheduler_id | Optional | Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that log into the same database. Regular expression can be used. |
| Optional Integer | Specifies the number of transfers the same notification to a System Monitor. Default: |
SystemMonitorNotification / Notification / NotificationObjects / TaskIfLongerThan
- JITL-522Getting issue details... STATUS
TaskIfLongerThan
includes the feature to send notification in case that the execution of job requires a longer duration than expected.
Requirements:
- The Job configuration contains the
warn_if_longer_than
setting. ./config/factory.ini
configuration file:mail_queue_only=true
mail_queue_dir
setting specifies a directory to store the JobScheduler mailsmail_on_warning=true
TaskIfLongerThan
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
scheduler_id | Optional | Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that log into the same database. Regular expression can be used. |
| Optional Integer | Specifies the number of transfers the same notification to a System Monitor. Default: |
SystemMonitorNotification / Notification / NotificationObjects / TaskIfShorterThan
- JITL-522Getting issue details... STATUS
TaskIfShorterThan
includes the feature to send notification in case that the execution of job requires a shorter duration than expected.
Requirements:
The Job configuration contains the
warn_if_shorter_than
setting../config/factory.ini
configuration file:mail_queue_only=true
mail_queue_dir
setting specifies a directory to store the JobScheduler mailsmail_on_warning=true
TaskIfShorterThan
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
scheduler_id | Optional | Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that log into the same database. Regular expression can be used. |
| Optional Integer | Specifies the number of transfers the same notification to a System Monitor. Default: |
SystemMonitorNotification / Timer
The following elements must be nested inside a Timer
element:
Element | Element description | Description |
---|---|---|
TimerJob | Optional or multiple use allowed inside the Timer element | |
TimerJobChain | Optional or multiple use allowed inside the Timer element | Restricts notifications for job chains |
Minimum | Optional or only once inside the Timer element | Minimum required execution time for job chains or selected job nodes. Allows script code to be executed that returns the minimum execution time in seconds. |
Maximum | Optional or only once inside the Timer element | Maximum allowed execution time for job chains or selected job nodes. Allows script code to be executed that returns the maximum execution time in seconds. |
Timer
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
name | Required | Corresponds to Timer used in the The name must be unique across all timers definitions. |
SystemMonitorNotification / Timer / TimerJob
- JITL-401Getting issue details... STATUS
TimerJob
supports the following attributes:
Atribute | Usage | Description |
---|---|---|
scheduler_id | Optional | Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that log into the same database. Regular expression can be used. |
name | Optional | Job name including possible folder names. Regular expression can be used. |
SystemMonitorNotification / Timer / TimerJobChain
TimerJobChain
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
scheduler_id | Optional | Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that log into the same database. Regular expression can be used. |
name | Optional | |
step_from | Optional | Restricts checks for job chains to a sequence of job nodes that are specified with the step_from and step_to attributes. |
step_to | Optional | Restricts checks for job chains to a sequence of job nodes that are specified with the step_from and step_to attributes. |
SystemMonitorNotification / Timer / Minimum
The following elements must be nested inside a Minimum
element:
Element | Element description | Description |
---|---|---|
Script | Required, only once inside the Minimum element | Script code in one of the supported languages |
SystemMonitorNotification / Timer / Maximum
The following elements must be nested inside a Maximum
element:
Element | Element description | Description |
---|---|---|
Script | Required, only once inside the Maximum element | Script code in one of the supported languages |
SystemMonitorNotification / Timer / Minimum|Maximum / Script
Script
supports the following attributes:
Attribute | Usage | Description |
---|---|---|
language | Required | Script language name Supported languages:
|
The Script element can contain:
- a fixed value
- a calculation based on the job/order parameters
Fixed value
A fixed value is the time allowed in seconds for the specific Minimum
or Maximum
definition
Calculation
The calculation is to result in the time in seconds for the specific Minimum
or Maximum
definition.
This example calculates the execution time depending on the ${file_size}
parameter that was set by a specific job (see the example below)´.
This example job calculates and creates a new order parameter file_size
.
To store the parameters into database (table SCHEDULER_MON_RESULTS
) :
- set the
scheduler_notification_result_parameters
parameter (see job documentationjobs/JobSchedulerNotificationStoreResultsJob.xml
) - set the
StoreResultsJobJSAdapterClass
as monitor- JobScheduler releases before 1.11
com.sos.scheduler.notification.jobs.result.StoreResultsJobJSAdapterClass
JobScheduler releases starting from 1.11
com.sos.jitl.notification.jobs.result.StoreResultsJobJSAdapterClass
- JobScheduler releases before 1.11
Message
Usage
The Message can be configured on the following parent nodes as a CDATA element :
SystemMonitorNotification / Notification /
NotificationInterface
SystemMonitorNotification / Notification / NotificationCommand
SystemMonitorNotification / Notification / NotificationMail
Subject
Body
SystemMonitorNotification / Notification / NotificationJMS / Message
The Message can contain:
- Fixed values
- Variables
Example: <![CDATA[ scheduler id = ${MON_N_SCHEDULER_ID} ]]>
Variables
All variables (except OS environment variables) must be defined by using of the
${<variable name>}
syntax.
Note:
- Syntax for the JobScheduler version 1.10.6 and higher. Syntax for the JobScheduler version 1.10.4, 1.10.5 (see below) is still supported.
- Syntax for the JobScheduler version 1.10.4, 1.10.5: {<variable name>}
- Syntax for the JobScheduler previous versions:
%<variable name>%
The order of the substitution the variables values is:
- Table variables.
- Service variables.
- JOC Cockpit variables.
- OS environment variables.
Table variables
Service variables
JOC Cockpit variables
- JS-1388Getting issue details... STATUS
Note:
- the JOC Cockpit variables will be substituted only when the
NotificationMail
interface is used.
Requirement:
-
config/private/private.conf
configuration file is active and contains the configuredjoc.url
entry.
OS environment variables
All existing OS environment variables can be defined by message using the syntax %<variable name>%
(Windows) or $<variable name>
(Unix)
.
Notification environment variables
The default SystemNotifierProcessBuilderPlugin
plugin used by the SystemMonitorNotification / Notification / NotificationCommand
element sets the following variables as environment variables:
Table variables
Service variables
These variables can be used when the NotificationCommand calls the notification client - not directly but via a shell script that makes the logical implementation for sending the notification messages.
Table variables
All table variables (see Table variables
explanation) are set as environment variables with the prefix:
SCHEDULER_MON_TABLE_
e.g.:
SCHEDULER_MON_TABLE_MON_N_ID
SCHEDULER_MON_TABLE_MON_N_SCHEDULER_ID
...
Service variables
Name | Description |
---|---|
| Current service name. One of both element attributes:
|
| Current service status. One of both element attributes or default:
|
|
|
| Content of the SystemMonitorNotification / Notification / NotificationCommand after substitution |
Examples
Message on error
scheduler id=${MON_N_SCHEDULER_ID}, history id=${MON_N_ORDER_HISTORY_ID}, job_chain=${MON_N_JOB_CHAIN_NAME}(${MON_N_ORDER_ID}), step=${MON_N_ORDER_STEP_STATE}, error=${MON_N_ERROR_TEXT}
Message on success
scheduler id=${MON_N_SCHEDULER_ID}, history id=${MON_N_ORDER_HISTORY_ID}, job_chain=${MON_N_JOB_CHAIN_NAME}(${MON_N_ORDER_ID}), steps(${MON_SN_STEP_FROM} to ${MON_SN_STEP_TO}), order time elapsed = ${MON_N_ORDER_TIME_ELAPSED}s
Message on performance check (Timer)
name = ${MON_C_NAME}, scheduler id=${MON_N_SCHEDULER_ID}, history id=${MON_N_ORDER_HISTORY_ID}, job_chain=${MON_N_JOB_CHAIN_NAME}(${MON_N_ORDER_ID}), steps(${MON_C_STEP_FROM} to ${MON_C_STEP_TO}), check = ${MON_C_CHECK_TEXT}
Examples System Monitoring
NotificationInterface ( Nagios / OP5 )
The following is an except from an XML file used to notify a specific System Monitor (op5 Monitor) via the NotificationInterface:
NotificationCommand ( Nagios / OP5 )
The following is an except from an XML file used to notifying a specific System Monitor (op5 Monitor) via the NotificationCommand:
NotificationCommand ( Nagios / Opsview )
The following is an except from an XML file used to notifying a specific System Monitor (Opsview Monitor) via the NotificationCommand on Unix:
NotificationCommand ( Zabbix )
The following is an except from an XML file used to notify a specific System Monitor (Zabbix Monitor) and using NotificationCommand
Examples Mail
NotificationMail content_type="text/html"
JobScheduler - Store parameters to database
The Monitoring Interface provide functionality to store the job/order parameters of the specific jobs into database (table SCHEDULER_MON_RESULTS
).
See explanation : Calculation
JobScheduler - Job Chains
The following job chains are provided and should be configured accordingly:
sos / notification / CheckHistory (JobScheduler releases before 1.11)
See <scheduler_install>/jobs/JobSchedulerNotificationCheckHistoryJob.xml
- This is the main job that analyze the JobScheduler history tables und write results into the notification tables.
- Job read all history entries for the job chains, configured in the
SystemMonitorNotification
XML files. - Job execute the performance checks for the defined
Timers
- Job read all history entries for the job chains, configured in the
- Order
Check
- configure repeat interval for order run time, e.g. every two minutes.
sos / notification / CheckHistory (JobScheduler releases starting from 1.11)
- Job chain removed
Set param
sos.use_notification true (config/scheduler.xml)
sos / notification / SystemNotifier
See <scheduler_install>/jobs/JobSchedulerNotificationSystemNotifierJob.xml
- Sends notifications to a specific System Monitor.
- Order
MonitorSystem
- JobScheduler releases before 1.11
- configures a repeat interval for the order run time that is not less than the interval that has been chosen for triggering the job chain
sos/notification/CheckHistory
- configures a repeat interval for the order run time that is not less than the interval that has been chosen for triggering the job chain
- JobScheduler releases before 1.11
sos / notification / CleanupNotifications
See <scheduler_install>/jobs/JobSchedulerNotificationCleanupNotificationsJob.xml
- Removes notifications that have expired.
- Order
Cleanup
- configure start time for order run time, e.g. 24:00
sos / notification / ResetNotifications
See <scheduler_install>/jobs/JobSchedulerNotificationResetNotificationsJob.xml
- Some System Monitors may provide an "acknowledge" operation, that signaling has known problem.
- Should an "acknowledge" operation have been performed for a specific service in the System Monitor then job chain
ResetNotifications
would stop JobScheduler from sending notifications for that service for errors that have already occurred. - Do not configure the order run time for this job chain, as job chain will be triggered by the System Monitor's "acknowledge" operation via add_order XML command.
Examples
Example ResetNotifications <add_order> XML command
The following example shows the XML command sent from a monitoring system to the JobScheduler to call the sos/notification/ResetNotifications
job chain and set the relevant service name as acknowledged.
Key to the above code:
Element | Attribute | Value | Description | |
---|---|---|---|---|
add_order | XML Command to add the new order to the specified job chain on the JobScheduler. | |||
job_chain | sos/notification/ResetNotifications | Job chain path must correspond with the path of the ResetNotifications job chain installed on the JobScheduler. | ||
id | Order identifier. | |||
title | Order title. | |||
param | 3 following parameters must be set: | |||
name | service_name | JobScheduler Monitoring Error | Relevant service name to set all already occured service errors in JobScheduler Interface Monitor as acknowledged. | |
name | system_id | op5 | System identification. Corresponds with | |
name | operation | acknowledge | Fixed value. Operation name to execute the acknowledgement in the JobScheduler Monitoring Interface. |
Example ResetNotifications <add_order> XML command via Perl script for op5 monitor system
This example shows the integration of a Perl script into op5 monitor system that automatically sends the above XML command to the JobScheduler sos/notification/ResetNotifications
job chain.
The "Acknowledgment" on the op5 Monitor side works as follows:
- Contact "acknowledgment" + Event Handler:
- it first of all requires a contact, that receives the Notifications in the same way as the other contacts. However, an event notification for this contact is not received via Mail but an Event Handler, i.e. an XML command will be executed instead of a mail being received. (Please see the next point,
Notification Command
.)
- it first of all requires a contact, that receives the Notifications in the same way as the other contacts. However, an event notification for this contact is not received via Mail but an Event Handler, i.e. an XML command will be executed instead of a mail being received. (Please see the next point,
- The "svc_notify_ack_handle"
Notification Command
:- this command will always be executed for the services that are specified for the contact. This command is executed when the service status changes (for example, by a change from
OK
toCritical
orAcknowledgment
of an Error). - The command executes a
check_acknowledge.pl
script.
- this command will always be executed for the services that are specified for the contact. This command is executed when the service status changes (for example, by a change from
- The
check_acknowledge.pl
Script (see the example below): this script is executed by the command and first of all checks whether the command is a response to anAcknowledgment
: - If the command is not a response to an
Acknowledgment
: then nothing happens - If the command is a response to an
Acknowledgment
: then the script causes the JobScheduler to be contacted and sent am XML query, that instructs the JobScheduler to start a specific job chain (thesos/notification/ResetNotifications
chain)
JobScheduler - Job Chains customization
The default name of the monitor system used in the configuration files and stored in the JobScheduler database is "MonitorSystem".
The default configuration can be changed to allow better customization of the monitoring systems used.
Example customization for the op5 system monitor:
<scheduler_install>/config/notification/SystemMonitorNotification_MonitorSystem.xml
- rename this file to
SystemMonitorNotification_op5.xml
- set
system_id
attribute toop5
e.g. <SystemMonitorNotification system_id="op5">
- rename this file to
<scheduler_install>/config/live/sos/notification/SystemNotifier,MonitorSystem.order.xml
- rename this file to
SystemNotifier,op5.order.xml
- set
system_configuration_file
attribute toSystemMonitorNotification_op5.xml
e.g.
<param name="system_configuration_file" value="config/notification/SystemMonitorNotification_op5.xml"/>
- rename this file to
-
<scheduler_install>/config/live/sos/notification/ResetNotifications,AcknowledgeMonitorSystem.order.xml
- rename this file to
ResetNotifications,Acknowledgeop5.order.xml
- set
system_id
op5
e.g.
<param name="system_id" value="op5"/>
- rename this file to
JobScheduler - Cluster
In case of Cluster Operation please modify the job_chain
element definition for all notification job chain files
- add
distributed="yes"
attribute.- e.g:
<job_chain distributed="yes" ...
- e.g:
- remove
orders_recoverable="no"
attribute if exists
Following job chain files must be modified in the notification directory
:<scheduler_install>/config/live/sos/notification/
CheckHistory.job_chain.xml
CleanupNotifications.job_chain.xml
ResetNotifications.job_chain.xml
SystemNotifier.job_chain.xml
Use Cases
Workflow Execution takes too long
Initial Situation
A Job Chain is triggered and it could not end, it hang in a step, taking longer than expected.
Problem
Execution time was too long
Handling
A timer for this Job Chain has been set and the System Monitor notified about it. The expiration times for the Job Chains are configured with enough time for processing. This is usually used for cases where the Job Chain could hang in a specific step.
Configuration
SystemMonitorNotification_<MonitorSystem>.xm
l- Configure SystemMonitorNotification / Timer
- Configure SystemMonitorNotification / Notification / NotificationObjects / TimerRef
- Configure
service_name_on_error
(SystemMonitorNotification / Notification / NotificationMonitor)
System Monitor
- Services in the System Monitor have to be configured and named the same way as in the
service_name_on_error
(SystemMonitorNotification / Notification / NotificationMonitor) above.
- Services in the System Monitor have to be configured and named the same way as in the
SFTP connection refused
Initial Situation
Consider a Job Chain that uses SFTP for transferring files. You have a setback configured in this step of the Job Chain, so that if the connection to the SFTP server fails, this step is retried after a specified time.
Problem
The SFTP server is not available anymore.
Handling
The System Monitor will be notified to the service related to the Job Chain with the message error. However, you don't want to have repeated notifications for a Job Chain when is an external factor, the connection to the SFTP Server, is producing the error.
Configuration
SystemMonitorNotification_<MonitorSystem>.xm
l- Configure SystemMonitorNotification / Notification / NotificationObjects / JobChain for relevant Job chain.
- Configure
service_name_on_error
(SystemMonitorNotification / Notification / NotificationMonitor)
System Monitor
- Services in the System Monitor have to be configured and named the same way as in the
service_name_on_error
(SystemMonitorNotification / Notification / NotificationMonitor) above.
- Services in the System Monitor have to be configured and named the same way as in the
Thresholds
Initial Situation
Consider the situation where a workflow has to be executed successfully a specific number of times before a specific point in time. This means that a specific value has to be monitored in order to determine if this quote was reached.
Handling
A new History service is configured, so that the workflow executions (Job Chains in the JobScheduler vocabulary) send the information that they have been successfully executed to the System Monitor.
Configuration
SystemMonitorNotification_<MonitorSystem>.xm
l- Configure SystemMonitorNotification / Notification / NotificationObjects / JobChain for relevant Job chain
- Configure
service_name_on_success
(SystemMonitorNotification / Notification / NotificationMonitor)
System Monitor
- Services in the System Monitor have to be configured and named the same way as in the
service_name_on_success
(SystemMonitorNotification / Notification / NotificationMonitor) above.
- Services in the System Monitor have to be configured and named the same way as in the
Acknowledgment
Initial Situation
An alert for a Service has been sent to the System Monitor, which has sent a Mail to the Service Desk (Support Team) notifying them about the alert.
Handling
The problem is known to the Service Desk and they "acknowledge" the problem. The acknowledgment will cause the JobScheduler to be notified not to send any more notifications for this Service to the System Monitor until the Service has been recovered.
Configuration
System Monitor
- The JobScheduler is notified about the acknowledgment in the System Monitor by the execution of a script. See sos / notification / ResetNotifications
Recoverable Errors
Initial Situation
You have a setback configured in one of the steps of the Job Chain, so that if the step execution fails, this step is retried after a specified time.
Problem
The step has ended with an error, but recovered after setback
Handling
If the error message has been sent to the System Monitor, in case of error recovery JobScheduler will automatically sent the recovery message on the same service with the same error message and the prefix RECOVERED.
Configuration
SystemMonitorNotification_<MonitorSystem>.xm
l- Configure SystemMonitorNotification / Notification / NotificationObjects / JobChain for relevant Job chain.
- Configure
service_name_on_error
(SystemMonitorNotification / Notification / NotificationMonitor)
System Monitor
- Services in the System Monitor have to be configured and named the same way as in the
service_name_on_error
(SystemMonitorNotification / Notification / NotificationMonitor) above.
- Services in the System Monitor have to be configured and named the same way as in the
Change Management References