Versions Compared

Key

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

...

Code Block
languagexml
titleExample
collapsetrue
...
<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
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>
...

...

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

Variables

All variables must variables (except OS environment variables) must be defined by using of the

${<variable name>}

syntax.

Note:

  • Syntax for the JobScheduler version 1.10.4 and higher6 and higher. Syntax for the JobScheduler version 1.10.4, 1.10.5 (see below) is still supported.
  • Syntax for the JobScheduler version 1.10.4, 1.10.5:  {<variable name>}
  • Syntax for the JobScheduler previous versions: %<variable name>%

...

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
 scheduler id = ${MON_N_SCHEDULER_ID}, history id = ${MON_N_ORDER_HISTORY_ID}, job_chain = ${MON_N_JOB_CHAIN_NAME}(${MON_N_ORDER_ID}), error = ${MON_N_ERROR_TEXT}
Expand
titleVariables: table SCHEDULER_MON_SYSNOTIFICATIONS

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

NameDescription
${MON_SN_ID}Unique system notification id 
${MON_SN_NOTIFICATION_ID}

Reference to the SCHEDULER_MON_NOTIFICATIONS.ID  table

${MON_SN_CHECK_ID}

Reference to the SCHEDULER_MON_CHECKS.ID   table

${MON_SN_SYSTEM_ID} 

Reference 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_OBJECT_TYPE}

NotificationObject type

  0 = JobChain

  1 = Job

100 = dummy code for interlal using 

${MON_SN_RETURN_CODE_FROM} 

Reference to the element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @return_code_from

defined in the XML configuration file

 
${MON_SN_RETURN_CODE_TO}

Reference to the element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @return_code_to

defined in the XML configuration file 

${MON_SN_STEP_FROM}

Reference to the element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @step_from

defined in the XML configuration file 

${MON_SN_STEP_TO}

Reference to the element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @step_to

defined in the XML configuration file 

${MON_SN_STEP_FROM_START_TIME}Timestamp for the start of the order step 
${MON_SN_STEP_TO_END_TIME}Timestamp for the end of the order step  
${MON_SN_STEP_TIME_ELAPSED} The elapsed time or the difference in seconds between the start and end times of the order step  
${MON_SN_NOTIFICATIONS}

Reference to element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @notifications

defined in the XML configuration file  

${MON_SN_CURRENT_NOTIFICATION}Number of notifications that already sent to a System Monitor
${MON_SN_MAX_NOTIFICATIONS}

0 = notifications counter was not reached

1 = notifications counter was reached, all configured notifications were sent

${MON_SN_ACKNOWLEDGED}

0 = not acknowledged

1 = acknowledged 

${MON_SN_RECOVERED}

0 = recovery not sent

1 = recovery sent

${MON_SN_SUCCESS}

0 = Notification onError, SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error

1 = Notification onSuccess, SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success

${MON_SN_CREATED}Timestamp of the initial system notification record  
${MON_SN_MODIFIED}Timestamp of the latest changes to this system notification record  
Code Block
languagexml
titleExample
collapsetrue
 step from = ${MON_SN_STEP_FROM}, step to = ${MON_SN_STEP_TO}, notification = ${MON_SN_CURRENT_NOTIFICATION} (of ${MON_SN_NOTIFICATIONS})
Expand
titleVariables: table SCHEDULER_MON_CHECKS

 Table of the history of executed checks (Timer)

NameDescription
${MON_C_ID}Unique check id  
${MON_C_NOTIFICATION_ID}

Reference to table SCHEDULER_MON_NOTIFICATIONS.ID   

${MON_C_NAME}

Reference to element attribute

SystemMonitorNotification / Timer / @name

defined in the XML configuration file 

${MON_C_STEP_FROM} 

Reference to element attribute

SystemMonitorNotification / Timer / TimerJobChain / @step_from

defined in the XML configuration file

 
${MON_C_STEP_TO}

Reference to element attribute

SystemMonitorNotification / Timer / TimerJobChain / @step_to

defined in the XML configuration file

${MON_C_STEP_FROM_START_TIME} Timestamp of the start of the order step  
${MON_C_STEP_TO_END_TIME} Timestamp of the end of the order step  
${MON_C_STEP_TIME_ELAPSED} The time or difference in seconds between a beginning time and an ending time of the order step   
${MON_C_CHECK_TEXT} Message of the check  
${MON_C_CREATED}Timestamp of the check initial record  
${MON_C_MODIFIED}Timestamp of the latest changes to this check 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 

...

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}            
Code Block
languagexml
titleMessage on success
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}), steps(${MON_SN_STEP_FROM} to ${MON_SN_STEP_TO}), order time elapsed = ${MON_N_ORDER_TIME_ELAPSED}s            
Code Block
languagexml
titleMessage on timer
collapsetrue
name = ${MON_C_NAME}, scheduler id=${MON_N_SCHEDULER_ID}, history id=${MON_N_ORDER_HISTORY_ID}, job_chain=${MON_N_JOB_CHAIN_NAME}(${MON_N_ORDER_ID}), steps(${MON_C_STEP_FROM} to ${MON_C_STEP_TO}), check = ${MON_C_CHECK_TEXT}            

...

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

...

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

...

...

Code Block
languagexml
titleSystemMonitorNotification_zabbix.xml
collapsetrue
... 
<!--
zabbix_sender            Zabbix sender installed on the JobScheduler host
localhost                Hostname of the zabbix server
Zabbix_server            JobScheduler Agent name(host name) that registred on Zabbix
samples.job1             Item key of zabbix (replace "/" to "." of JOB_NAME
${MON_N_ERROR_TEXT}       See explanation "Table variables"
-->
<NotificationCommand>
<![CDATA[zabbix_sender -z localhost -s zabbix_server -k samples.job1 -o ${MON_N_ERROR_TEXT}]]>
</NotificationCommand>
...

...