Versions Compared

Key

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

...

Code Block
languagexml
titleExample
collapsetrue
...
<NotificationCommand><![CDATA[
echo scheduler id=%MON{MON_N_SCHEDULER_ID%ID}, history id=%MON{MON_N_ORDER_HISTORY_ID%ID}, job_chain=%MON{MON_N_JOB_CHAIN_NAME%NAME}(%MON{MON_N_ORDER_ID%ID}), step =%MON{MON_N_ORDER_STEP_STATE%STATE}, error=%MON{MON_N_ERROR_TEXT%TEXT} > D://errors.txt
]]></NotificationCommand>
...

...

ElementElement descriptionDescription
JobChainOptional, once or more inside of NotificationObjects elementRestricts notifications for job chains
JobOptional, once or more inside of NotificationObjects element Restricts notifications for jobs
TimerRefTimerOptional, once or more inside of NotificationObjects elementRestricts notifications for performance checks (Timer)

...

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 log into the same database.

Regular expression can be used.

nameOptional

Job chain name including possible folder names.

Regular expression can be used.

return_code_from Optional Restricts notifications for job chains  for a particular return code range. 
return_code_from Optional  Restricts notifications for job chains for a particular return code range.  
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 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" stepreturn_code_from="2005"/> 
... 
<JobChain name="test/my_jobchain" stepreturn_code_to="50010"/>
... 
<JobChain name="test/my_jobchain" stepreturn_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 /

...

Job

Timer Job supports the following attributes:

AttributeUsageDescription
notifications

Optional

Integer

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

Default: 1

namescheduler_idOptionalCorresponds with Timer name setting defined in the SystemMonitorNotification / Timer element

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

Regular expression can be used.

nameOptional

Job name including possible folder names.

Regular expression can be used.

return_code_from Optional Restricts notifications for jobs for a particular return code range. 
return_code_from Optional  Restricts notifications for jobs for a particular return code range.  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
...
<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 / TimerRef

TimerRef supports the following attributes:

AttributeUsageDescription
notifications

Optional

Integer

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

Default: 1

refOptionalCorresponds 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> 
     <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). 
      --> 
      <Timer<TimerRef nameref="my_timer" /> 
    </NotificationObjects> 
 </Notification>   
 
 <Timer name="my_timer"> 
    <JobChain<TimerJobChain name="test/my_jobchain" /> 
 </Timer> 
</SystemMonitorNotification> 

...

ElementElement descriptionDescription
JobChainTimerJobChainOnce or more inside of Timer elementRestricts notifications for job chains
MinimumOptional or once inside of Timer elementMinimum required execution time for job chains or selected job nodes. Allows script code to be executed that returns the minimum execution time in seconds.
MaximumOptional or once inside of Timer elementMaximum allowed execution time for job chains or selected job nodes. Allows script code to be executed that returns the maximum execution time in seconds.
Code Block
languagexml
titleExample
collapsetrue
<SystemMonitorNotification system_id="op5"> 
  ... 
  <Timer name="my_timer_1"> 
    <JobChain<TimerJobChain name="test/my_jobchain_1" /> 
    <Maximum><Script language="javascript"><![CDATA[1000]]></Script></Maximum> 
  </Timer> 
 
  <Timer name="my_timer_2"> 
    <JobChain<TimerJobChain name="test/my_jobchain_2" /> 
    <JobChain<TimerJobChain name="test/my_jobchain_3" /> 
    <Minimum><Script language="javascript"><![CDATA[500]]></Script></Minimum> 
    <Maximum><Script language="javascript"><![CDATA[1000]]></Script></Maximum> 
  </Timer> 
</SystemMonitorNotification> 

...

AttributeUsageDescription
 nameRequired

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

The name must be unique across all timers definitions.

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

 

SystemMonitorNotification / Timer /

...

TimerJobChain

JobChain TimerJobChain support the following attributes:

...

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

...

Expand
titleVariables: table SCHEDULER_MON_NOTIFICATIONS

 Table of the history of steps of processed orders.

NameDescription 
%MON{MON_N_ID%ID}Unique notification id
%MON{MON_N_SCHEDULER_ID% ID} Id of the JobScheduler
%MON{MON_N_TASK_ID%ID}Id of the JobScheduler task 
%MON{MON_N_STEP%STEP} Consecutive number of the order step
%MON{MON_N_ORDER_HISTORY_ID% ID} Id of the JobScheduler order 
%MON{MON_N_JOB_CHAIN_NAME%NAME} Name of the job chain of the order 
%MON{MON_N_JOB_CHAIN_TITLE%TITLE}Title of the job chain of the order  
%MON{MON_N_ORDER_ID% ID} Unique (within the job chain) id of the order 
%MON{MON_N_ORDER_TITLE% TITLE} Title of the order 
%MON{MON_N_ORDER_START_TIME%TIME} Timestamp of the start of the order
%MON{MON_N_ORDER_END_TIME% TIME} Timestamp of the end of the order
%MON{MON_N_ORDER_TIME_ELAPSED% ELAPSED} The time or difference in seconds between a beginning time and an ending time of the order
%MON{MON_N_ORDER_STEP_STATE% STATE} State of the order inside the job chain
%MON{MON_N_ORDER_STEP_START_TIME%TIME}Timestamp of the start of the order step 
%MON{MON_N_ORDER_STEP_END_TIME% TIME} Timestamp of the end of the order step 
%MON{MON_N_ORDER_STEP_TIME_ELAPSED%ELAPSED}The time or difference in seconds between a beginning time and an ending time of the order step 
%MON{MON_N_JOB_NAME%NAME}Name of the job 
%MON{MON_N_JOB_TITLE% TITLE}Title of the job
%MON{MON_N_TASK_START_TIME%TIME}Timestamp of the job task start 
%MON{MON_N_TASK_END_TIME% TIME} Timestamp of the job task end
%MON{MON_N_TASK_TIME_ELAPSED%ELAPSED} The time or difference in seconds between a beginning time and an ending time of the job task
%MON{MON_N_RECOVERED% 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%MON_N_ERROR%ERROR}

0 = ok

1 = error 

%MON{MON_N_ERROR_CODE% CODE} Exception-code of the job error 
%MON{MON_N_ERROR_TEXT%TEXT}Exception message of the job (that processed the order) 
%MON{MON_N_CREATED% CREATED} Timestamp of the notification initial record 
%MON{MON_N_MODIFIED%MODIFIED}Timestamp of the latest changes to this notification record 

...

Code Block
languagexml
titleExample
collapsetrue
 scheduler id = %MON{MON_N_SCHEDULER_ID%ID}, history id = %MON{MON_N_ORDER_HISTORY_ID%ID}, job_chain = %MON{MON_N_JOB_CHAIN_NAME%NAME}(%MON{MON_N_ORDER_ID%ID}), error = %MON{MON_N_ERROR_TEXT%TEXT}
Expand
titleVariables: table SCHEDULER_MON_SYSNOTIFICATIONS

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

MON_CHECKS.ID   table
NameDescription
%MON{MON_SN_ID%ID}Unique system notification id 
%MON{MON_SN_NOTIFICATION_ID%ID}

Reference to the SCHEDULER_MON_NOTIFICATIONS.ID  table

%MON{MON_SN_CHECK_ID%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} %MON_SN_SYSTEM_ID% 

Reference to the element attribute

SystemMonitorNotification / @system_id/ Notification / NotificationObjects / JobChain / @return_code_from

defined in the XML configuration file

%MON {MON_SN_RETURN_SERVICECODE_NAME%TO}

Reference to one of both element attributesto the element attribute

SystemMonitorNotification / Notification /

NotificationMonitor / @service_name_on_errorSystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success

NotificationObjects / JobChain / @return_code_to

defined in the XML configuration file 

%MON{MON_SN_STEP_FROM%FROM}

Reference to the element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @step_from

defined in the XML configuration file 

%MON{MON_SN_STEP_TO%TO}

Reference to the element attribute

SystemMonitorNotification / Notification / NotificationObjects / JobChain / @step_to

defined in the XML configuration file 

%MON{MON_SN_STEP_FROM_START_TIME%TIME}Timestamp for the start of the order step 
%MON{MON_SN_STEP_TO_END_TIME%TIME}Timestamp for the end of the order step  
%MON{MON_SN_STEP_TIME_ELAPSED%ELAPSED} The elapsed time or the difference in seconds between the start and end times of the order step  
%MON_SN_NOTIFICATIONS%Number of notifications that already sent to a System Monitor
order step  
{MON%MON_SN_MAX_NOTIFICATIONS%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%MON_SN_ACKNOWLEDGED%ACKNOWLEDGED}

0 = not acknowledged

1 = acknowledged 

%MON{MON_SN_RECOVERED%RECOVERED}

0 = recovery not sent

1 = recovery sent

%MON{MON_SN_SUCCESS%SUCCESS}

0 = success not sent

1 = success sent

Notification onError, SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error

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

{MON_SN_CREATED}%MON_SN_CREATED%Timestamp of the initial system notification record  
%MON{MON_SN_MODIFIED%MODIFIED}Timestamp of the latest changes to this system notification record  
Code Block
languagexml
titleExample
collapsetrue
 step from = %MON{MON_SN_STEP_FROM%FROM}, step to = %MON{MON_SN_STEP_TO%TO}, notification = %MON{MON_SN_NOTIFICATIONS%CURRENT_NOTIFICATION} (of %MON{MON_SN_MAX_NOTIFICATIONS%NOTIFICATIONS})
Expand
titleVariables: table SCHEDULER_MON_CHECKS

 Table of the history of executed checks (Timer)

NameDescription
%MON{MON_C_ID%ID}Unique check id  
%MON{MON_C_NOTIFICATION_ID%ID}

Reference to table SCHEDULER_MON_NOTIFICATIONS.ID   

%MON{MON_C_NAME%NAME}

Reference to element attribute

SystemMonitorNotification / Timer / @name

defined in the XML configuration file 

%MON{MON_C_STEP_FROM%FROM} 

Reference to element attribute

SystemMonitorNotification / Timer / JobChain TimerJobChain / @step_from

defined in the XML configuration file

 
%MON{MON_C_STEP_TO%TO}

Reference to element attribute

SystemMonitorNotification / Timer / JobChain TimerJobChain / @step_to

defined in the XML configuration file

%MON{MON_C_STEP_FROM_START_TIME% TIME} Timestamp of the start of the order step  
%MON{MON_C_STEP_TO_END_TIME% TIME} Timestamp of the end of the order step  
%MON{MON_C_STEP_TIME_ELAPSED%ELAPSED} The time or difference in seconds between a beginning time and an ending time of the order step   
%MON{MON_C_CHECK_TEXT% TEXT} Message of the check  
%MON{MON_C_CREATED%CREATED}Timestamp of the check initial record  
%MON{MON_C_MODIFIED%MODIFIED}Timestamp of the latest changes to this check record 
Code Block
languagexml
titleExample
collapsetrue
 timer name = %MON{MON_C_NAME%NAME}, text = %MON{MON_C_CHECK_TEXT%TEXT}
Service variables
Expand
titleVariables
NameDescription
%SERVICE{SERVICE_NAME%NAME}

Current service name. One of both element attributes:

  • SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error
  • SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success
%SERVICE{SERVICE_STATUS%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{SERVICE_MESSAGE_PREFIX%PREFIX}

Message prefix

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

 

OS environment variables 

...

Code Block
languagexml
titleMessage on error
collapsetrue
scheduler id=%MON{MON_N_SCHEDULER_ID%ID}, history id=%MON{MON_N_ORDER_HISTORY_ID%ID}, job_chain=%MON{MON_N_JOB_CHAIN_NAME%NAME}(%MON{MON_N_ORDER_ID%ID}), step=%MON{MON_N_ORDER_STEP_STATE%STATE}, error=%MON{MON_N_ERROR_TEXT%          TEXT}            
Code Block
languagexml
titleMessage on success
collapsetrue
scheduler id=%MON{MON_N_SCHEDULER_ID%ID}, history id=%MON{MON_N_ORDER_HISTORY_ID%ID}, job_chain=%MON{MON_N_JOB_CHAIN_NAME%NAME}(%MON{MON_N_ORDER_ID%ID}), steps(%MON{MON_SN_STEP_FROM%FROM} to %MON{MON_SN_STEP_TO%TO}), order time elapsed = %MON{MON_N_ORDER_TIME_ELAPSED%s           ELAPSED}s            
Code Block
languagexml
titleMessage on timer
collapsetrue
name = %MON{MON_C_NAME%NAME}, scheduler id=%MON{MON_N_SCHEDULER_ID%ID}, history id=%MON{MON_N_ORDER_HISTORY_ID%ID}, job_chain=%MON{MON_N_JOB_CHAIN_NAME%NAME}(%MON{MON_N_ORDER_ID%ID}), steps(%MON{MON_C_STEP_FROM%FROM} to %MON{MON_C_STEP_TO%TO}), check = %MON{MON_C_CHECK_TEXT%           TEXT}            

Notification environment variables

...

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{MON_N_SCHEDULER_ID%ID}    See explanation "Table variables"
...
-->
<NotificationInterface monitor_host="monitor_host" monitor_port="5667" monitor_encryption="XOR" service_host="service_host"><![CDATA[
scheduler id=%MON{MON_N_SCHEDULER_ID%ID}, history id=%MON{MON_N_ORDER_HISTORY_ID%ID}, job_chain=%MON{MON_N_JOB_CHAIN_NAME%NAME}(%MON{MON_N_ORDER_ID%ID}), step =%MON{MON_N_ORDER_STEP_STATE%STATE}, error=%MON{MON_N_ERROR_TEXT%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{SERVICE_NAME%NAME}             See explanation "Service variables"
%SERVICE{SERVICE_STATUS%STATUS}           See explanation "Service variables"
%SERVICE{SERVICE_MESSAGE_PREFIX%PREFIX}   See explanation "Service variables"
%MON{MON_N_SCHEDULER_ID%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{SERVICE_NAME%:%SERVICE{SERVICE_STATUS%:%SERVICE{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{MON_N_ERROR_TEXT%TEXT}       See explanation "Table variables"
-->
<NotificationCommand>
<![CDATA[zabbix_sender -z localhost -s zabbix_server -k samples.job1 -o %MON{MON_N_ERROR_TEXT%TEXT}]]>
</NotificationCommand>
...

...