Versions Compared

Key

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

...

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

Status
colourYellow
titlework in progress

...

Examples

Examples OP5
NotificationInterface 

 

Here is an except of an XML file used for notifying a specific System Monitor (OP5 Monitor) and using NotificationInterface

Code Block
languagexml
titleSystemMonitorNotification_op5.xml
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>
...
NotificationCommand

Here is an except of an XML file used for notifying a specific System Monitor (OP5 Monitor) and using NotificationCommand on Windows

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"
...
Output after substitution e.g.:
<![CDATA[echo service_host:JobScheduler Errors:CRITICAL: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 : ]]>
-->
<NotificationMonitor service_name_on_error="JobScheduler Errors">
  <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>

...
Examples Zabbix
NotificationCommand

Here is an except of an XML file used for notifying a specific System Monitor (Zabbix Monitor) and using NotificationCommand under Linux

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
-->
<NotificationCommand>
<![CDATA[/bin/sh -c | zabbix_sender -z localhost -s zabbix_server -k samples.job1 -o %ERROR%%MON_N_ERROR_TEXT%]]>
</NotificationCommand>
...

 

 

 

Status
colourYellow
titlework in progress

JobScheduler - Job Chains

...

  • System Monitor: The step of notifying JobScheduler through an acknowledgement in the System Monitor is an execution of a script. This is nothing else than a notification, like sending a mail for instance, but instead, another action is executed, which is the execution of the script that contacts JobScheduler and add an order to the JobChain ResetNotifications described above.