...
Element | Element description | Description |
---|---|---|
SystemMonitorNotification | Top Level Element | Configuration for notifications to be sent to a system monitor. |
Notification | Once or more inside a SystemMonitorNotification element | Specifies a system monitor notification that includes a command line invocation and the JobScheduler objects. |
Timer | Optional, once or more inside a SystemMonitorNotification element | Performance measurement definition. |
SystemMonitorNotification
Jira | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<SystemMonitorNotification system_id="op5"> ... |
SystemMonitorNotification / Notification
The following elements may be nested inside a Notification
element:
Element | Element description | Description |
---|---|---|
NotificationMonitor | Once inside a 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 | Once inside a Notification element | Specifies the Job Chain and the Timer definitions |
SystemMonitorNotification / Notification / NotificationMonitor
NotificationMonitor
supports the following attributes:
...
Element | Element description | Description |
---|---|---|
NotificationInterface | Optional, once inside of NotificationMonitor element | Plug-in Interface to be executed for System Monitor notification |
NotificationCommand | Optional, once inside of NotificationMonitor element | Command line to be executed for System Monitor notification |
SystemMonitorNotification / Notification / NotificationMonitor / NotificationInterface
NotificationInterface
support the following attributes:
...
Note | ||
---|---|---|
| ||
In case you are using Opsview as the monitoring tool, the plugin used in Instead, you should use the XML element |
SystemMonitorNotification / Notification / NotificationMonitor / NotificationCommand
NotificationCommand
support the following attributes:
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
... <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 | ||||||
---|---|---|---|---|---|---|
| ||||||
<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 | ||||||
---|---|---|---|---|---|---|
| ||||||
... <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 | ||||||
---|---|---|---|---|---|---|
| ||||||
... <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 | ||||||
---|---|---|---|---|---|---|
| ||||||
<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 | ||||||
---|---|---|---|---|---|---|
| ||||||
... <Timer name="my_timer"> ... |
SystemMonitorNotification / Timer / TimerJobChain
TimerJobChain
support the following attributes:
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
... <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 | ||||||
---|---|---|---|---|---|---|
| ||||||
... <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 | ||||||
---|---|---|---|---|---|---|
| ||||||
... <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 | ||||||
---|---|---|---|---|---|---|
| ||||||
... <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 | ||||||
---|---|---|---|---|---|---|
| ||||||
<?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
...
- Table variables.
- Service variables.
- OS environment variables.
Table variables variables
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Table of the history of steps of processed orders.
|
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
timer name = {MON_C_NAME}, text = {MON_C_CHECK_TEXT} |
Service variables
Expand | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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 | ||||||
---|---|---|---|---|---|---|
| ||||||
%TEMP%/test.exe |
Examples
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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 | ||
---|---|---|
| ||
All table variables (see
e.g.:
|
Service variables
Expand | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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:
...
Anchorexample_zabbix example_zabbix
Examples Zabbix
example_zabbix | |
example_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.
...
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.
...
Jira | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|