...
Expand |
---|
title | Variables: table SCHEDULER_MON_SYSNOTIFICATIONS |
---|
|
Table of the history of notifications sended to system monitor. Name | Description |
---|
%MON_SN_ID% | Unique system notification id | %MON_SN_NOTIFICATION_ID% | Reference to table SCHEDULER_MON_NOTIFICATIONS .ID | %MON_SN_CHECK_ID% | Reference to table SCHEDULER_MON_CHECKS .ID | %MON_SN_SYSTEM_ID% | Reference to element attribute SystemMonitorNotification / @system_id
defined in the XML configuration file | %MON_SN_SERVICE_NAME% | Reference to element attributeto one of both element attributes SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error orSystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success
defined in the XML configuration file | %MON_SN_STEP_FROM% | Reference to element attribute SystemMonitorNotification / Notification / NotificationObjects / JobChain / @step_from
defined in the XML configuration file | %MON_SN_STEP_TO% | Reference to element attribute SystemMonitorNotification / Notification / NotificationObjects / JobChain / @step_to
defined in the XML configuration file | %MON_SN_STEP_FROM_START_TIME% | Timestamp of the start of the order step | %MON_SN_STEP_TO_END_TIME% | Timestamp of the end of the order step | %MON_SN_STEP_TIME_ELAPSED% | The time or difference in seconds between a beginning time and an ending time of the order step | %MON_SN_NOTIFICATIONS% | Number of notifications that already sended to a System Monitor | %MON_SN_MAX_NOTIFICATIONS% | Reference to element attribute SystemMonitorNotification / Notification / NotificationObjects / JobChain / @notifications
defined in the XML configuration file | %MON_SN_ACKNOWLEDGED% | 0 = not acknowledged
1 = acknowledged
| %MON_SN_RECOVERED% | 0 = recovery not sended
1 = recovery sended
| %MON_SN_SUCCESS% | 0 = success not sended
1 = success sended
| %MON_SN_CREATED% | Timestamp of the system notification initial record | %MON_SN_MODIFIED% | Timestamp of the latest changes to this system notification record |
|
...
Expand |
---|
|
Name | Description |
---|
%SERVICE_NAME% | Current service name. One of both element attributes: SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error orSystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success
| %SERVICE_STATUS% | Current service status status. One of both element attributes or default: SystemMonitorNotification / Notification / NotificationMonitor / @service_status_on_error orSystemMonitorNotification / Notification / NotificationMonitor / @service_status_on_success
- default
CRITICAL error - default
OK success
| %SERVICE_MESSAGE_PREFIX% | Message prefix ERROR sending of the error notificationRECOVERED sending of the error error recovery notificationTIMER sending of the performance check notificationperformance check
|
|
Code Block |
---|
language | xml |
---|
title | Example |
---|
collapse | true |
---|
|
service name = %SERVICE_NAME% |
...
These variables can be used when the NotificationCommand calls the notification client not directly, but a shell script, that make the logical implementation for sending of the notification messages.
Service variables
...
|
code |
| bash | Description |
---|
SCHEDULER_MON_SERVICE_NAME
| Current service name. One of both element attributes: - SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error
- SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_success
| SCHEDULER_MON_SERVICE_STATUS
| Current service status. One of both element attributes or default: SystemMonitorNotification / Notification / NotificationMonitor / @service_name_on_error | SCHEDULER
|
|
title | Sample NotificationCommand Unix. Script file (/tmp/command.sh). |
---|
collapse | true |
---|
1) configured command in the SystemMonitorNotification_<MonitorSystem>.xml file
<NotificationCommand><![CDATA[/tmp/command.sh]</NotificationCommand>
2) content of the /tmp/command.sh file
#! /bin/sh
# Note: "> /tmp/command_output.txt" used to simulate the starting of the notification client
#
echo $SCHEDULER_MON_SERVICE_NAME:$SCHEDULER_MON_SERVICE_STATUS:$SCHEDULER_MON_SERVICE_MESSAGE_PREFIX
|
history id = $SCHEDULER | ERROR error RECOVERED error recovery TIMER performance check
| SCHEDULER_MON_
|
TABLE_MON_N_ORDER_HISTORY_ID > /tmp/command_output.txt
|
...
Tables variables
Expand |
---|
|
| Name | DescriptionAll tables variables (see tables variables explanation) have the prefix
SCHEDULER_MON_
SERVICE_STATUSValue of attribute service_name_on_error
or service_name_on_success
TABLE_
e.g.:
SCHEDULER_MON_TABLE_MON_N_ID
SCHEDULER_MON_
SERVICE_NAMEValue of attribute service_status_on_error or service_status_on_success |
---|
SCHEDULER_MON_SERVICE_MESSAGE_PREFIX
| ERROR if error occured RECOVERED if error recovered TIMER if performance check
|
SCHEDULER_MON_SERVICE_COMMAND
| |
Tables variables
TABLE_MON_N_SCHEDULER_ID
...
|
Code Block |
---|
language | bash |
---|
title | Sample NotificationCommand Unix. Script file (/tmp/command.sh). |
---|
collapse | true |
---|
|
1) configured command in the SystemMonitorNotification_<MonitorSystem>.xml file
<NotificationCommand><![CDATA[/tmp/command.sh]</NotificationCommand>
2) content of the /tmp/command.sh file
#! /bin/sh
# Note: "> /tmp/command_output.txt" used to simulate the starting of the notification client
#
echo $SCHEDULER_MON_SERVICE_NAME:$SCHEDULER_MON_SERVICE_STATUS:$SCHEDULER_MON_SERVICE_MESSAGE_PREFIX history id = $SCHEDULER_ |
Expand |
---|
|
All tables variables (see tables variables explanation) have the prefix SCHEDULER_MON_TABLE_
e.g.: SCHEDULER_MON_TABLE_MON_N_ID SCHEDULER_MON_TABLE_MON_N_ORDER_ SCHEDULERHISTORY_ID ...
> /tmp/command_output.txt
|
Status |
---|
colour | Yellow |
---|
title | work in progress |
---|
|
...
- 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.