Versions Compared

Key

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

...

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

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

...

Code Block
languagexml
titleExample
collapsetrue
<SystemMonitorNotification system_id="op5">
...


SystemMonitorNotification / Notification

The following elements may be nested inside a Notification element:

ElementElement descriptionDescription
NotificationMonitorOnce inside a Notification elementSpecifies the System Monitor interface that is being used for messages: either by a Plug-in Interface or by command line invocation
NotificationObjectsOnce inside a Notification elementSpecifies the Job Chain and the Timer definitions
SystemMonitorNotification / Notification / NotificationMonitor

NotificationMonitor supports the following attributes:

...

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

 

SystemMonitorNotification / Notification / NotificationMonitor / NotificationInterface

NotificationInterface support the following attributes:

...

Note
titleSystem 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 could only use it in case you use no encryption (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 from a remote machine (see example for op5 or example for zabbix).

 

SystemMonitorNotification / Notification / NotificationMonitor / NotificationCommand

NotificationCommand support the following attributes:

...

Code Block
languagexml
titleExample
collapsetrue
...
<NotificationCommand><![CDATA[
echo 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} > D://errors.txt
]]></NotificationCommand>
...
SystemMonitorNotification / Notification / NotificationObjects

One of the following elements must be nested inside a NotificationObjects element:

...

Code Block
languagexml
titleExample
collapsetrue
<SystemMonitorNotification system_id="op5"> 
  <Notification> 
    <NotificationMonitor service_name_on_error="JobScheduler Monitoring Errors"> 
      ... 
    </NotificationMonitor> 
    <NotificationObjects>
      <!-- Send the job error, occurrent in the "test/my_job" order job, to the "JobScheduler Monitoring Errors" service. -->        
      <Job name="test/my_job" /> 
      <!-- Send the job chain error, occurrent in the "test/my_jobchain" job chain, to the "JobScheduler Monitoring Errors" service. --> 
      <JobChain name="test/my_jobchain" /> 
    </NotificationObjects> 
 </Notification> 
</SystemMonitorNotification>  

 

SystemMonitorNotification / Notification / NotificationObjects / Job

Job supports the following attributes:

...

Code Block
languagexml
titleExample
collapsetrue
...
<Job notifications="2" name="test/my_job"/>
...
<Job scheduler_id="scheduler_4444" />
...
<Job scheduler_id="scheduler_4444" name="^(test/my)" />
... 
<Job name="test/my_job" return_code_from="5"/> 
...  
<Job name="test/my_job" return_code_to="10"/>
...  
<Job name="test/my_job" return_code_from="5" return_code_to="5"/>  
...

 

SystemMonitorNotification / Notification / NotificationObjects / JobChain

JobChain supports the following attributes:

...

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" return_code_from="5"/> 
... 
<JobChain name="test/my_jobchain" return_code_to="10"/>
... 
<JobChain name="test/my_jobchain" return_code_from="5" return_code_to="5"/>  
...
<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 / TimerRef

TimerRef supports the following attributes:

...

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, occurring 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> 
      <!-- 
      Sends the performance check error, occurring in the "test/my_jobchain" job chain, to the "JobScheduler Monitoring Performance" service. 
      Sends the performance check error to the "JobScheduler Monitoring Performance" service will be ignored when the "test/my_jobchain" has the job chain error (default notify_on_error = false). 
      --> 
      <TimerRef ref="my_timer" /> 
    </NotificationObjects> 
 </Notification>   
 
 <Timer name="my_timer"> 
    <TimerJobChain name="test/my_jobchain" /> 
 </Timer> 
</SystemMonitorNotification> 

 

SystemMonitorNotification / Timer 

The following elements must be nested inside a Timer element:

...

Code Block
languagexml
titleExample
collapsetrue
...
<Timer name="my_timer">
... 

 

SystemMonitorNotification / Timer / TimerJobChain

TimerJobChain support the following attributes:

...

Code Block
languagexml
titleExample
collapsetrue
...
<TimerJobChain scheduler_id="scheduler_4444" /> 
... 
<TimerJobChain scheduler_id="scheduler_4444" name="^(test/my)" /> 
... 
<TimerJobChain name="test/my_jobchain" step_from="200"/> 
... 
<TimerJobChain name="test/my_jobchain" step_to="500"/> 
... 
<TimerJobChain name="test/my_jobchain" step_from="300" step_to="300"/>
...

 

SystemMonitorNotification / Timer / Minimum

The following elements must be nested inside a Minimum element:

...

Code Block
languagexml
titleExample
collapsetrue
...
<Timer name="my_timer">
  ...
  <Minimum><Script language="javascript"><![CDATA[1000]]></Script></Minimum>
</Timer>
... 

 

SystemMonitorNotification / Timer / Maximum

The following elements must be nested inside a Maximum element:

...

Code Block
languagexml
titleExample
collapsetrue
...
<Timer name="my_timer">
  ...
  <Maximum><Script language="javascript"><![CDATA[1000]]></Script></Maximum>
</Timer>
... 

 

SystemMonitorNotification / Timer / Minimum|Maximum / Script

Script supports the following attributes:

...

  • 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

Code Block
languagexml
titleExample (fixed value)
collapsetrue
...
  <Script language="javascript"><![CDATA[1000]]></Script>
...
Calculation

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

...

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> 

Message

Usage

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

...

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

Variables

All variables must be defined by using of the

...

  1. Table variables.
  2. Service variables.
  3. OS environment variables. 
Table variables variables
Expand
titleVariables: table SCHEDULER_MON_NOTIFICATIONS

 Table of the history of steps of processed orders.

NameDescription 
{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_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_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 

...

Code Block
languagexml
titleExample
collapsetrue
 timer name = {MON_C_NAME}, text = {MON_C_CHECK_TEXT}
Service variables
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

  • ERROR       error
  • RECOVERED     error recovery
  • TIMER       performance check
Code Block
languagexml
titleExample
collapsetrue
 service name = {SERVICE_NAME}

 

OS environment variables variables 

 

All existing OS environment variables can be defined by message using the syntax %<variable name>% (Windows) or $<variable name> (Unix).

Code Block
languagexml
titleExample Windows
collapsetrue
 %TEMP%/test.exe

 

Examples 
Code Block
languagexml
titleMessage on error
collapsetrue
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}            

...

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
Expand
titleVariables

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
Expand
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 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

Examples op5
NotificationInterface 

The following is an except from an XML file used to notify a specific System Monitor (op5 Monitor) via the NotificationInterface:

...

Anchor
example_zabbix
example_zabbix
Examples Zabbix
NotificationCommand

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

...

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

...

ElementAttributeValue Description
add_order   XML Command to add the new order to the specified job chain on the JobScheduler.
 job_chainsos/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:
 nameservice_name
JobScheduler Monitoring Error
Relevant service name to set all already occured service errors in JobScheduler Interface Monitor as acknowledged.
 namesystem_idop5

System identification.

Corresponds with SystemMonitorNotification/@system_id setting in the  SystemMonitorNotification_<MonitorSystem>.xml configuration file.

 nameoperationacknowledgeFixed 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.

...

Jira
serverSOS JIRA
columnstype,key,issuelinks,fixversions,status,priority,summary,updated
maximumIssues20
jqlQuerylabels in (monitoring)
serverId6dc67751-9d67-34cd-985b-194a8cdc9602