Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

...

Recovery messages

...

Notify on success

SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success is configured.

...

SystemMonitorNotification / Notification / NotificationObjects / Job

...

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

Configuration

JobScheduler

Activation of Monitoring Interface 

Note: 

  • JobScheduler releases before 1.13.1
    • SystemMonitorNotification_<MonitorSystem>.xml file(s) (see below) must be configured before activtion.
  • 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

FileDescription
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 files but not the XML schema file.

SystemMonitorNotification_<MonitorSystem>.xml

 Configuration file for each System Monitor.

  • Specifies the delivery way to System Monitor.
  • Specifies notification for error or success conditions
  • Specifies notification to measure performance of JobScheduler objects
 

SystemMonitorNotificationTimers.xml

Configuration file for all System Monitors.

  • Specifies notification to measure performance of JobScheduler objects

This file is optional and contains the definitions of the SystemMonitorNotification / Timer elements.

SystemMonitorNotification Elements

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

FileDescription
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:

  • Specifies the delivery way to System Monitor.
  • Specifies notification for error or success conditions
  • Specifies notification to measure performance of JobScheduler objects
  • this file is an automatically generated file and will be overridden when the configuration is deployed


SystemMonitorNotification Elements

The configuration The configuration element descriptions are organized into the following major categories:

...

SystemMonitorNotification supports the following attributes:

System Monitor identifier.

See JobScheduler - Job Chains customization 
AttributeJobScheduler releaseUsageDescription
system_idbefore 1.13.1required

System Monitor identifier.

See JobScheduler - Job Chains customization 

Note:

  • attribute system_id 
    • in case of the SystemMonitorNotificationTimers.xml the value of this attribute is not important and can have any value.

      • e.g.: timers

AttributeUsageDescription

starting from 1.13.1required
  • If a configuration is created by JOC Cockpit the value of the attribute system_id
required
  • will be ignored.
    • The SystemNotifier job chain will use MonitorSystem as identifier instead.
Code Block
languagexml
titleExample
collapsetrue
<SystemMonitorNotification system_id="op5">
...

...

The JobScheduler Interface Monitor can be used to monitor the messages for the 3 use cases:

  • error case
    • an error has occured occurred / been recovered during a job chain / job execution
      • the service_name_on_error setting is responsible for this monitoring case
  • success case
    • a job chain / job ends succesfullysuccessfully
      • the service_name_on_success setting is responsible for this monitoring case
  • 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 the service_name_on_success setting has been defined.

...

  • attributes service_name_on_error and service_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:

...

Code Block
languagexml
titleExample
collapsetrue
<!-- Example 
op5 NSCA Status: 
0 - OK 
1 - WARNING 
2 - CRITICAL 
3 - UNKNOWN --> 
... 
<!-- Sending occurred errors as CRITICAL (default) --> 
<NotificationMonitor service_name_on_error="JobScheduler Monitoring Errors"> 
... 
<!-- Sending occurred errors as WARNING --> 
<NotificationMonitor service_name_on_error="JobScheduler Monitoring Errors" service_status_on_error="1"> 
...

...

AttributeUsageDescription
monitor_hostRequiredThis setting specifies the host name or ip IP address of the System Monitor host.
monitor_portRequiredThis setting specifies the TCP port that the System Monitor would will listen to.
monitor_passwordOptional

This setting specifies the password

  • for NSCA - the password is configured in the ncsa.cfg file.
monitor_connection_timeoutOptional

This setting specifies the connection timeout in ms.

Default: 5000

monitor_response_timeoutOptionalThis setting specifies the response timeout in ms.
monitor_encryptionOptional

This setting specifies that the communication with the System Monitor is encrypted. By default no encryption is used.

  • NONE             - no encryption
  • XOR            - XOR encryption
  • TRIPLE_DES - use of triple des algorithm for encryption
service_hostRequiredThis setting specifies the name of the host that executes the passive check. The name must match the corresponding setting in the System Monitor.
pluginOptional

Default:

    • JobScheduler version releases before 1.9.x, 1.10.x11

      • com.sos.scheduler.notification.plugins.notifier.SystemNotifierSendNscaPlugin
    • JobScheduler version releases starting from 1.11.x, 1.12.x

      • com.sos.jitl.notification.plugins.notifier.SystemNotifierSendNscaPlugin

...

Note
titleSystem Monitor: Opsview

In case you are using Opsview OpsView as the monitoring tool, the plugin used in NotificationInterface will not work, since Opsview OpsView supports 20 types of encryption, which are not supported by this plugin. You could only can use it only in case you use that no encryption is used (type: NONE) and that will work .

Instead, you should use the XML element NotificationCommand and indicate there the exact command to send passive checks to your Opsview an OpsView server from a remote machine (see example for op5 or example for zabbix).

...

AttributeUsageDescription
pluginOptional

Default:

  • JobScheduler version JobScheduler releases before 1.9.x, 1.10.x 11
    • com.sos.scheduler.notification.plugins.notifier.SystemNotifierProcessBuilderPlugin
  • JobScheduler version releases starting from 1.11.x, 1.12.x

    • com.sos.jitl.notification.plugins.notifier.SystemNotifierProcessBuilderPlugin


...

Code Block
languagexml
titleExample
collapsetrue
...
<Body><![CDATA[<style type<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/css">
html; charset=utf-8"/>
    <style>.tg  {border-collapse:collapse;border-spacing:0;border-color:#bbb#aaa;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#bbb#aaa;color:#594F4F#333;background-color:#E0FFEB#fff;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normalbold;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#bbb#aaa;color:#493F3F#fff;background-color:#9DE0AD#f38630;}</style>
    <title>JobScheduler Notification</title>
</style>head>
<body>
<table class="tg">
    <tr>
        <th colspan="4">Error</th>
    </tr>
    <tr>
        <td>Code:</td><td>${MON_N_ERROR_CODE}</td>
        <td>Messsage</td><td>${MON_N_ERROR_TEXT}</td>
    </tr>
    <tr>
        <th colspan="4">JobScheduler</th>
    </tr>
    <tr>
        <td>JobScheduler ID</td><td>${MON_N_SCHEDULER_ID}</td>
        <td>Agent URL</td><td>${MON_N_AGENT_URL}</td>
    </tr>
    <tr>
        <th colspan="4">Order</th>
    </tr>
    <tr>
        <td>Order ID</td><td><a href="${JOC_HREF_ORDER}">${MON_N_ORDER_ID}</a></td>
        <td>Order Title</td><td>${MON_N_ORDER_TITLE}</td>
    </tr>
    <tr>
        <td>Job Chain Name</td><td><a href="${JOC_HREF_JOB_CHAIN}">${MON_N_JOB_CHAIN_NAME}</a></td>
        <td>Job Chain Title</td><td>${MON_N_JOB_CHAIN_TITLE}</td>
    </tr>
    <tr>
        <td>Job Name</td><td><a href="${JOC_HREF_JOB}">${MON_N_JOB_NAME}${MON_N_JOB_NAME}</a></td>
        <td>Job Title</td><td>${MON_N_JOB_TITLE}</td>
    </tr>
    <tr>
        <th colspan="4">Task History</th>
    </tr>
    <tr>
        <td>Task ID</td><td>${MON_N_TASK_ID}</td>
        <td>Time elapsed</td><td>${MON_N_TASK_TIME_ELAPSED}</td>
    </tr>
    <tr>
        <td>Start Time</td><td>${MON_N_TASK_START_TIME}</td>
        <td>End Time</td><td>${MON_N_TASK_END_TIME}</td>
    </tr>
</table>]]></Body>
...
</body>
</html>


SystemMonitorNotification / Notification / NotificationMonitor / NotificationJMS

...

  • set the scheduler_notification_result_parameters parameter (see job documentation jobs/JobSchedulerNotificationStoreResultsJob.xml)
  • set the StoreResultsJobJSAdapterClass as monitor
    • JobScheduler version releases before 1.9.x, 1.10.x11
      • com.sos.scheduler.notification.jobs.result.StoreResultsJobJSAdapterClass
    • JobScheduler version releases starting from 1.11.x, 1.12.x

      • com.sos.jitl.notification.jobs.result.StoreResultsJobJSAdapterClass
Code Block
languagexml
titleExample (order job)
collapsetrue
<?xml version="1.0" encoding="ISO-8859-1"?> 
<job  title="Sample Job with Store Result Monitor" order="yes" stop_on_error="no" tasks="1">     
  <params>
     <!--
     set the scheduler_notification_result_parameters parameter
     -->         
    <param name="scheduler_notification_result_parameters" value="file_size"/>     
  </params>     
  
  <!--
  calculate and create the new order parameter if necessary
  -->
  <script language="java:javascript"><![CDATA[             
      function spooler_process(){                                  
        var order    = spooler_task.order;                 
        var params   = spooler.create_variable_set();                 
        params.merge(spooler_task.params);                 
        params.merge(order.params);                      
        
        // parameter scheduler_file_path was set in the previous job chain step
        var file     = new java.io.File(params.value("scheduler_file_path"));                 
        var fileSize = file.length()/1024;                 
        order.params.set_var("file_size",fileSize.toString());                          
      return true;             
      }]]>     
   </script>          
 
   <!-- 
   set the StoreResultsJobJSAdapterClass as a monitor
   -->     
   <monitor  name="notification_monitor" ordering="1">         
     	<!-- JobScheduler version 1.9.x,releases before 1.10.x11
	<script java_class="com.sos.scheduler.notification.jobs.result.StoreResultsJobJSAdapterClass" language="java"/>
        -->
   
        <!-- JobScheduler releases starting versionfrom 1.11.x, 1.12.x --> 
        <script java_class="com.sos.jitl.notification.jobs.result.StoreResultsJobJSAdapterClass" language="java"/> 
   </monitor>

   <run_time /> 
</job> 

...

Expand
titleVariables: table SCHEDULER_MON_NOTIFICATIONS

 Table of the history of steps of processed orders / jobs.

NameDescription  Note
${MON_N_ID}
Unique notification id
${MON_N_SCHEDULER_ID} Id of the JobScheduler
${MON_N_TASK_ID}Id of the JobScheduler task 
${MON_N_STEP} Consecutive number of the order step
${MON_N_ORDER_HISTORY_ID} Id of the JobScheduler order 
${MON_N_JOB_CHAIN_NAME} Name of the job chain of the order 
${MON_N_JOB_CHAIN_TITLE}Title of the job chain of the order  
${MON_N_ORDER_ID} Unique (within the job chain) id of the order 
${MON_N_ORDER_TITLE} Title of the order 
${MON_N_ORDER_START_TIME} Timestamp of the start of the order
${MON_N_ORDER_END_TIME} Timestamp of the end of the order
${MON_N_ORDER_TIME_ELAPSED} The time or difference in seconds between a beginning time and an ending time of the order
${MON_N_ORDER_STEP_STATE} State of the order inside the job chain
${MON_N_ORDER_STEP_START_TIME}Timestamp of the start of the order step 
${MON_N_ORDER_STEP_END_TIME} Timestamp of the end of the order step 
${MON_N_ORDER_STEP_TIME_ELAPSED}The time or difference in seconds between a beginning time and an ending time of the order step 
${MON_N_JOB_NAME}Name of the job 
${MON_N_JOB_TITLE}Title of the job
${MON_N_JOB_CRITICALITY}User defined job criticality

Available with release 1.13.3

Jira
serverSOS JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId6dc67751-9d67-34cd-985b-194a8cdc9602
keyJOC-850

${MON_N_TASK_START_TIME}Timestamp of the job task start 
${MON_N_TASK_END_TIME} Timestamp of the job task end
${MON_N_TASK_TIME_ELAPSED} The time or difference in seconds between a beginning time and an ending time of the job task
${MON_N_RECOVERED} 

0 = dependent of the ${MON_N_ERROR} - ok or error was not recovered,

1 = error was recovered  


${MON_N_RETURN_CODE}Return code number 
${MON_N_AGENT_URL}JobScheduler Agent uri 

Available with release 1.11.2

Jira
serverSOS JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId6dc67751-9d67-34cd-985b-194a8cdc9602
keyJITL-351

${MON_N_CLUSTER_MEMBER_ID} ID of the Scheduler cluster member (only used in cluster mode)

Available with release 1.11.2

Jira
serverSOS JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId6dc67751-9d67-34cd-985b-194a8cdc9602
keyJITL-352

${MON_N_ERROR}

0 = ok

1 = error 


${MON_N_ERROR_CODE} Exception-code of the job error 
${MON_N_ERROR_TEXT}Exception message of the job (that processed the order) 
${MON_N_CREATED} Timestamp of the notification initial record 
${MON_N_MODIFIED}Timestamp of the latest changes to this notification record 

...

Expand
titleVariables
NameDescription
${SERVICE_NAME}

Current service name. One of both element attributes:

  • SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error
  • SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success
${SERVICE_STATUS}

Current service status. One of both element attributes or default: 

  • SystemMonitorNotification / Notification / NotificationMonitor / @service_status_on_error
  • SystemMonitorNotification / Notification / NotificationMonitor / @service_status_on_success
  • default CRITICAL error
  • default OK       success
${SERVICE_MESSAGE_PREFIX}

Message prefix

  • SUCCESS     success (JobScheduler versions releases from 1.10.11 and , 1.12.8, 1.13)
  • ERROR       error
  • RECOVERED     error recovery
  • TIMER       performance check

...

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

...

titleVariables
NameDescription

SCHEDULER_MON_SERVICE_NAME

Current service name. One of both element attributes:

  • SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error
  • SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success

SCHEDULER_MON_SERVICE_STATUS

Current service status. One of both element attributes or default:

  • SystemMonitorNotification / Notification / NotificationMonitor / @service_status_on_error
  • SystemMonitorNotification / Notification / NotificationMonitor / @service_status_on_success
  • default CRITICAL error
  • default OK       success

SCHEDULER_MON_SERVICE_MESSAGE_PREFIX

  • ERROR      error                           
  • RECOVERED    error recovery                            
  • TIMER             performance check 

SCHEDULER_MON_SERVICE_COMMAND

 Content of the SystemMonitorNotification / Notification / NotificationCommand after substitution

  

Code Block
languagebash
titleSample NotificationCommand Unix. Script file (/tmp/command.sh).
collapsetrue
1) configured command in the SystemMonitorNotification_<MonitorSystem>.xml file
<NotificationCommand><![CDATA[/tmp/command.sh]</NotificationCommand>
 
2) content of the /tmp/command.sh file
#! /bin/sh 
# Note: "> /tmp/command_output.txt" is used to simulate the starting of the notification client
#
echo "$SCHEDULER_MON_SERVICE_NAME:$SCHEDULER_MON_SERVICE_STATUS:$SCHEDULER_MON_SERVICE_MESSAGE_PREFIX history id = $SCHEDULER_MON_TABLE_MON_N_ORDER_HISTORY_ID" > /tmp/command_output.txt
 

...

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
  • 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)

...

  • Sends notifications to a specific System Monitor.
  • Order MonitorSystem
    • JobScheduler version releases before 1.9.x, 1.10.x11
      • 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

...

SFTP connection refused

...

Thresholds

Initial Situation

...

Acknowledgment

Initial Situation

...

Change Management References

...