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.

Send notifications

Notify on error

SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error is configured.

SystemMonitorNotification / Notification / NotificationObjects / JobChain
Error messages
Recovery messages
SystemMonitorNotification / Notification / NotificationObjects / Job
Error messages

Notify on success

SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success is configured.

SystemMonitorNotification / Notification / NotificationObjects / JobChain
Success messages
SystemMonitorNotification / Notification / NotificationObjects / Job
Success messages

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.

...

...

AttributeUsageDescription
monitor_hostRequiredThis setting specifies the 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

  • for NSCA - password 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 1.9.x, 1.10.x

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

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

...

AttributeUsageDescription
pluginOptional

Default:

  • JobScheduler version 1.9.x, 1.10.x 
    • com.sos.scheduler.notification.plugins.notifier.SystemNotifierProcessBuilderPlugin
  • JobScheduler version 1.11.x, 1.12.x

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


...

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 

Note:

This element specifies the order-controlled or standalone jobs for which notifications are being sent to a system monitor.

...

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:

...

  • set the scheduler_notification_result_parameters parameter (see job documentation jobs/JobSchedulerNotificationStoreResultsJob.xml)
  • set the StoreResultsJobJSAdapterClass as monitor
    • JobScheduler version 1.9.x, 1.10.x
      • com.sos.scheduler.notification.jobs.result.StoreResultsJobJSAdapterClass
    • JobScheduler version 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, 1.10.x
	<script java_class="com.sos.scheduler.notification.jobs.result.StoreResultsJobJSAdapterClass" language="java"/>
        -->
   
        <!-- JobScheduler version 1.11.x, 1.12.x --> 
        <script java_class="com.sos.jitl.notification.jobs.result.StoreResultsJobJSAdapterClass" language="java"/> 
   </monitor>

   <run_time /> 
</job> 

...

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 from 1.10.11 and 1.12.8)
  • ERROR       error
  • RECOVERED     error recovery
  • TIMER       performance check

...

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

...

Code Block
languagexml
titleSystemMonitorNotification_OP5.xml
collapsetrue
... 
<!--
service_host               The host that executes the passive check. The name must match the corresponding setting in the System Monitor.
monitor_host               The hostname or ip address of System Monitor host.
{SERVICE_NAME}             See explanation "Service variables"
{SERVICE_STATUS}           See explanation "Service variables"
{SERVICE_MESSAGE_PREFIX}   See explanation "Service variables"
{MON_N_SCHEDULER_ID}       See explanation "Table variables"
...
NotificationCommand after substitution (error case):
<![CDATA[echo service_host:JobScheduler Monitoring Errors:2:ERROR scheduler id=scheduler_4444, history id=123, job_chain=test/my_jobchain(order_id), step=100, error=error occurred | D:\nsca\send_nsca.exe -H monitor_host -c D:\nsca\send_nsca.cfg -d : ]]>
 
NotificationCommand after substitution (recovery case): 
<![CDATA[echo service_host:JobScheduler Monitoring Errors:0:RECOVERED scheduler id=scheduler_4444, history id=123, job_chain=test/my_jobchain(order_id), step=100, error=error occurred | D:\nsca\send_nsca.exe -H monitor_host -c D:\nsca\send_nsca.cfg -d : ]]> 
 
NotificationCommand after substitution (success case):  
<![CDATA[echo service_host:JobScheduler Monitoring Success:0:SUCCESS scheduler id=scheduler_4444, history id=123, job_chain=test/my_jobchain(order_id), step=100, error= | D:\nsca\send_nsca.exe -H monitor_host -c D:\nsca\send_nsca.cfg -d : ]]>  
 
-->
<NotificationMonitor service_name_on_error="JobScheduler Monitoring Errors" 
                     service_name_on_success="JobScheduler Monitoring Success" 
                     service_status_on_error="2" 
                     service_status_on_success="0">
  <NotificationCommand><![CDATA[echo service_host:${SERVICE_NAME}:${SERVICE_STATUS}:${SERVICE_MESSAGE_PREFIX}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:\nsca\send_nsca.exe -H monitor_host -c D:\nsca\send_nsca.cfg -d : ]]>
  </NotificationCommand>  
</NotificationMonitor>

...

...

  • 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 version 1.11.x, 1.12.x)

  • Job chain removed
  • Set param sos.use_notification true (config/scheduler.xml)

...