Versions Compared

Key

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

...

FileDescription
SystemMonitorNotification_v1.0.xsd

The XML Schema file that defines which values are allowed in your XML files for the JobScheduler monitoring.

That means , you just have to modify your SystemMonitorNotification_<MonitorSystem>.xml files in order to that to configure the JobScheduler objects you want to monitor and the System Monitor you want to use but just have to modify your SystemMonitorNotification_<MonitorSystem>.xml files but not the XML schema does not have to be modifiedfile.

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.

...

ElementElement descriptionDescription
SystemMonitorNotificationTop Level ElementConfiguration for notifications to be sent to a system monitor.
NotificationOnce or more inside a SystemMonitorNotification elementSpecifies a system monitor notification that includes a command line invocation and the JobScheduler objects.
TimerOptional, once or more inside a SystemMonitorNotification elementPerformance measurement definition.
SystemMonitorNotification

SystemMonitorNotification support supports the following attributes:

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

...

ElementElement descriptionDescription
NotificationInterfaceOptional, once inside of NotificationMonitor elementPlugin Plug-in Interface to be executed for System Monitor notification
NotificationCommandOptional, once inside of NotificationMonitor elementCommand line to be executed for System Monitor notification

...

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

This setting specifies the password configured in the ncsa.cfg file used by NSCA.

monitor_connection_timeoutOptional

This setting specifies the connection timeout in ms.

Default: 5000

monitor_response_timeoutOptionalThis setting specifies the NSCA 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.
pluginOptionalDefault: com.sos.scheduler.notification.plugins.notifier.SystemNotifierSendNscaPlugin

...

SystemMonitorNotification / Notification / NotificationObjects / JobChain

JobChain support supports the following attributes:

AttributeUsageDescription
notifications

Optional

Integer

Specifies the number of notifications that are sent to a System Monitor.

Default: 1

scheduler_idOptional

Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that would log into the same database.

Regular expression can be used.

nameOptional

Job chain name including possible folder names.

Regular expression can be used.

step_fromOptionalRestricts notifications for job chains to a sequence of job nodes that are specified with the step_from and step_to attributes.
step_toOptionalRestricts notifications for job chains to a sequence of job nodes that are specified with the step_from and step_to attributes.
excluded_stepsOptionalSpecifies the steps which will be excluded from the analysing analyzing (separated by semicolon)
Code Block
languagexml
titleExample
collapsetrue
...
<JobChain notifications="2" name="test/my_jobchain"/>
...
<JobChain scheduler_id="scheduler_4444" />
...
<JobChain scheduler_id="scheduler_4444" name="^(test/my)" />
...
<JobChain name="test/my_jobchain" step_from="200"/>
...
<JobChain name="test/my_jobchain" step_to="500"/>
...
<JobChain name="test/my_jobchain" step_from="300" step_to="300"/>
...
<JobChain name="test/my_jobchain" excluded_steps="200;300"/>
...

...

SystemMonitorNotification / Notification / NotificationObjects / Timer

Timer support supports the following attributes:

AttributeUsageDescription
notifications

Optional

Integer

Specifies the number of notifications that are sent to a System Monitor.

Default: 1

nameOptionalCorrespondence to 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: false

Code Block
languagexml
titleExample
collapsetrue
<SystemMonitorNotification system_id="OP5"> 
  <Notification> 
    <NotificationMonitor service_name_on_error="JobScheduler Monitoring Error"> 
      ... 
    </NotificationMonitor> 
    <NotificationObjects> 
     <!-- 
     Send the job chain error, occurrentoccurring in the "test/my_jobchain" job chain, to the "JobScheduler Monitoring Errors" service. 
     --> 
     <JobChain name="test/my_jobchain" /> 
    </NotificationObjects> 
  </Notification>   
 
  <Notification> 
    <NotificationMonitor service_name_on_error="JobScheduler Monitoring Performance"> 
      ... 
    </NotificationMonitor> 
    <NotificationObjects> 
      <!-- 
      SendSends the performance check error, occurrentoccurring in the "test/my_jobchain" job chain, to the "JobScheduler Monitoring Performance" service. 
      Send ofSends the performance check error to the "JobScheduler Monitoring Performance" service .
      willWill be ignored when the "test/my_jobchain" has the job chain error (default notify_on_error = false). 
      --> 
      <Timer name="my_timer" /> 
    </NotificationObjects> 
 </Notification>   
 
 <Timer name="my_timer"> 
    <JobChain name="test/my_jobchain" /> 
 </Timer> 
</SystemMonitorNotification> 

...

ElementElement descriptionDescription
JobChainOnce or more inside of Timer elementRestricts notifications for job chains
MinimumOptional or once inside of Timer elementMinimum required time consumption required for job or job chain execution. Allows script code to be executed that returns the minimum execution time required in seconds.
MaximumOptional or once inside of Timer elementMaximum allowed time consumption time required for job or job chain execution. Allows script code to be executed that returns the maximum execution time required in seconds.

...

AttributeUsageDescription
 nameRequired

Correspondence Corresponds to Timer used in the SystemMonitorNotification / Notification / NotificationObjects / Timer element.

The name must be unique across all timers definitions.

...

AttributeUsageDescription
 scheduler_idOptional

Notifications are restricted to the JobScheduler instance with the given identification. By default notifications will be sent for all JobScheduler instances that would log into the same database.

Regular expression can be used.

 nameOptional

Job chain name including possible folder names.

Regular expression can be used.

 step_fromOptionalRestricts checks for job chains to a sequence of job nodes that are specified with the step_from and step_to attributes.
 step_toOptionalRestricts checks for job chains to a sequence of job nodes that are specified with the step_from and step_to attributes.

...

SystemMonitorNotification / Timer / Minimum|Maximum / Script

Script support supports the following attributes:

AttributeUsageDescription
 languageRequired

Script language name

Supported languages:

  • javascript
  • ECMAScript 

 The Script element can containscontain:

  • a fixed value
  • a calculation based on the job/order parametes parameters
Fixed value

Fixed A fixed value is the duration time allowed in seconds for the specific Minimum or Maximum definition

...

Calculation

The calculation result is to result in the time in seconds for the specific Minimum or Maximum definition.

This example calculate calculates the execution time dependend of depending on the %file_size% parameter , that was set by a specific job (see the example below)´.

Code Block
languagexml
titleExample (calculation)
collapsetrue
...
  <Script language="javascript"><![CDATA[                     
    function my_calculate(){                         
      var fileSize              = new java.lang.Double(%file_size%);                         
      var timerExpiryFactor     = 0.0025;                         
      var timerExpiryTolerance  = timerExpiryFactor*0.1;                         
      var timerExpiry           = new java.lang.Double(timerExpiryFactor+timerExpiryTolerance);                         
      timerExpiry               = timerExpiry*fileSize;                     
      return timerExpiry;                     
    }                         
    my_calculate();
  ]]></Script>
...

 

This example job calculate calculates and create a creates a new order parameter file_size.

...

Code Block
languagexml
titleExample (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="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 com.sos.scheduler.notification.jobs.result.StoreResultsJobJSAdapterClass as a monitor
   -->     
   <monitor  name="notification_monitor" ordering="1">         
     <script java_class="com.sos.scheduler.notification.jobs.result.StoreResultsJobJSAdapterClass" language="java"/>     
   </monitor>

   <run_time /> 
</job> 

...

The Message can be configured on the following parent nodes as a CDATA element :

  • SystemMonitorNotification / Notification / NotificationCommand
  • SystemMonitorNotification / Notification / NotificationInterface

The Message can containscontain

  • fixed values
  • variables

Example: <![CDATA[ scheduler id = %MON_N_SCHEDULER_ID%  ]]>

...

Expand
titleVariables: table SCHEDULER_MON_SYSNOTIFICATIONS

 Table of the history of notifications sended sent to a system monitor.

NameDescription
%MON_SN_ID%Unique system notification id 
%MON_SN_NOTIFICATION_ID%

Reference to table the SCHEDULER_MON_NOTIFICATIONS.ID    table

%MON_SN_CHECK_ID%

Reference to table to the SCHEDULER_MON_CHECKS.ID      table

%MON_SN_SYSTEM_ID% 

Reference to element to the element attribute

SystemMonitorNotification / @system_id

defined in the XML configuration file

%MON_SN_SERVICE_NAME%

Reference to one of both element attributes

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

defined in the XML configuration file 

%MON_SN_STEP_FROM%

Reference to element to the element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @step_from

defined in the XML configuration file 

%MON_SN_STEP_TO%

Reference to element to the element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @step_to

defined in the XML configuration file 

%MON_SN_STEP_FROM_START_TIME%Timestamp of for the start of the order step 
%MON_SN_STEP_TO_END_TIME%Timestamp of for the end of the order step  
%MON_SN_STEP_TIME_ELAPSED% The elapsed time or the difference in seconds between a beginning time and an ending time of the start and end times of the order step  
%MON_SN_NOTIFICATIONS%Number of notifications that already sended sent to a System Monitor
%MON_SN_MAX_NOTIFICATIONS%

Reference to element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @notifications

defined in the XML configuration file  

%MON_SN_ACKNOWLEDGED%

0 = not acknowledged

1 = acknowledged 

%MON_SN_RECOVERED%

0 = recovery not sendedsent

1 = recovery sended sent

%MON_SN_SUCCESS%

0 = success not sendedsent

1 = success sended sent

%MON_SN_CREATED%Timestamp of the initial system notification initial notification record  
%MON_SN_MODIFIED%Timestamp of the latest changes to this system notification record  

...

All existing system variables can be defined by message with using the syntax like %<variable name>% (Windows/Unix).

...

These variables can be used when the NotificationCommand calls the notification client - not directly , but via a shell script , that make makes the logical implementation for sending of the notification messages.

...

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
 
Code Block
languagebash
titleSample NotificationCommand Windows. Script file (C:/temp/command.cmd).
collapsetrue
1) configured command in the SystemMonitorNotification_<MonitorSystem>.xml file
<NotificationCommand><![CDATA[C:/Temp/command.cmd]</NotificationCommand>
 
2) content of the C:/Temp/command.cmd file
rem Note: "> C:/Temp/command_output.txt" is used to simulate the starting of the notification client
rem
echo %SCHEDULER_MON_SERVICE_NAME%:%SCHEDULER_MON_SERVICE_STATUS%:%SCHEDULER_MON_SERVICE_MESSAGE_PREFIX% history id = %SCHEDULER_MON_TABLE_MON_N_ORDER_HISTORY_ID% > C:/Temp/command_output.txt
 

...

Examples OP5
NotificationInterface 

Here The following is an except of from an XML file used for notifying to notify a specific System Monitor (OP5 Monitor) and using via the NotificationInterface:

Code Block
languagexml
titleSystemMonitorNotification_OP5.xml
collapsetrue
 ...
<!--
monitor_host            The hostname or ip address of System Monitor host 
monitor_port            The TCP port that the System Monitor would listen to
monitor_encryption      Encryption algorithm
service_host            The host that executes the passive check. The name must match the corresponding setting in the System Monitor
%MON_N_SCHEDULER_ID%    See explanation "Table variables"
...
-->
<NotificationInterface monitor_host="monitor_host" monitor_port="5667" monitor_encryption="XOR" service_host="service_host"><![CDATA[
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%
]]></NotificationInterface>
...
NotificationCommand

Here The following is an except of from an XML file used for to notifying a specific System Monitor (OP5 Monitor) and using via the NotificationCommand on Windows:

...

Examples Zabbix
NotificationCommand

Here The following is an except of from an XML file used for notifying to notify a specific System Monitor (Zabbix Monitor) and using NotificationCommand

...

Initial Situation: A Job Chain is triggered by directory monitoring . That is, - i.e. the Job Chain starts when a certain file comes arrives in a monitored folder, the Job Chain starts.

Problem: The Job Chain has ended with an error.

Handling: The System Monitor will be notified to with the error message via the service related to specified for the Job Chain with the message error. If a new execution of the Job Chain from is then restarted by the arrival of a new file end and ends without errorsan error, this does not mean that the original error is has been recovered, since the file that has been processed is now another one. That issecond run has involved the processing of a different file. Instead, the error message at the System Monitor will stay till the same file is again placed in should remain unchanged until the original file has been re-added to the monitored directory and the Job Chain ends has ended without errorsan error.

Configuration:

  • XML CheckConfigurationHistory.xml: Indicate Indicates the ID of the JobScheduler and the name of the Job Chain you want to monitor.
  • XML SystemMonitorNotification.xml: Specify Specifies the name of the Service (in the System Monitor) and specify specifies that it is about a service_name_on_error since you want to have the control when the Job Chain ends in an error.
  • System Monitor: Services in the System Monitor have to be configured and named the same way as in the XML file above  SystemMonitorNotification.xml XML file above.

Workflow Execution takes too long

Initial Situation: A Job Chain is triggered and it could not end, it hanged hang in a step, taking then longer than expected.

Problem: Execution time was too long

Handling: A timer for this Job Chain is has been set and the System Monitor will be notified about it. The expiration times for the Job Chains are configured with enough time for processing, that means, this . This is usually used for cases where the Job Chain hanged could hang in a specific step.

Configuration:

  • XML CheckConfigurationHistory.xml: As in the example above , indicate - indicates the ID of the JobScheduler and the name of the Job Chain you want to monitor. MoreoverIn addition, specify the timer for this specific job chain and the function to calculate for calculating the expiration time for the timer should be specified.
  • XML SystemMonitorNotification.xml: As in the example above , specify - specifies the name of the Service (in the System Monitor) and specify that it is about a service_name_on_error since you want to have the control when if the Job Chain ends in with an error. Moreover and It is essential for this particular case , specify how many that the number of times the timer should notify your System Monitor about the expiration of a timer should be specified.
  • System Monitor: As in the example above , - Services in the System Monitor have to be configured and named the same way as in the XML file above  SystemMonitorNotification.xml file above.

SFTP connection refused

Initial Situation: There is 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 some 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 a bunch of repeated notifications for a Job Chain when is an external factor, the connection to the SFTP Server, what is producing the error.

Configuration:

  • XML CheckConfigurationHistory.xml: As in the example above , indicate - indicates the ID of the JobScheduler and the name of the Job Chain you want to monitor.
  • XML SystemMonitorNotification.xml: As in the example above , specify - specifies the name of the Service (in the System Monitor) and specify that it is about a service_name_on_error since as you want to have the control when if the Job Chain ends in an error. Moreover and Note that it is very important in this case , specify how many that the number of times this Job Chain should notify your System Monitor about the error connecting to the SFTP Server is specified. You can use step_from and step_to for that this in order to reduce the number of notifications for this specific step.
  • System Monitor: As in the example above , - Services in the System Monitor have to be configured and named the same way as in the XML file above  SystemMonitorNotification.xml file above.

Thresholds

Initial Situation: For example, a specific number of Workflow Executions have Consider the situation where a workflow has to be executed successfully till some specific time. That is, 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 for History is configured, so that the workflow executions (Job Chains in the JobScheduler vocabulary) send the information that they were have been successfully executed and finished to the System Monitor.

Configuration:

  • XML CheckConfigurationHistory.xml: As in the example above , indicate - indicates the ID of the JobScheduler and the name of the Job Chain you want to monitor.
  • XML SystemMonitorNotification.xml: Specify Specifies the name of the Service (in the System Monitor) but now specify note that here it is about a service_name_on_success since you want to have the control when the Job Chain ends in an success, and not only when it ends on error.
  • System Monitor: As in the example above , - Services in the System Monitor have to be configured and named the same way as in the XML file above  SystemMonitorNotification.xml file above.

...

Acknowledgment

Initial Situation: An alert for a Service has been sent to the System Monitor and , which has sent a Mail has been sent to the Service Desk (Support Team) notifying them about itthe alert.

Handling: The problem is well known by to the Service Desk and the they "acknowledge" the problem. Through The acknowledgment will cause the acknowledgement JobScheduler will to be notified not to and will not send any more notification notifications for this Service to the System Monitor till until the Service is again has been recovered.

Configuration:

  • System Monitor: The step of notifying JobScheduler through an acknowledgement JobScheduler is notified about the acknowledgment in the System Monitor is an by the execution of a script. This is nothing else than a notification, like has parallels to other notifications such as sending a mail for instance, but instead, another action is executed, which is the execution of the script that contacts JobScheduler and add but in this case the script adds an order to the JobChain ResetNotifications described above.

...