Introduction
JS7 - Notifications are managed from the Configuration->Notification sub-view of JOC Cockpit.
- The configuration format of notifications is XML. The JOC Cockpit offers an XSD schema-aware XML Editor for configuration purposes.
XSD Schema Location
- JS7 release 2.0 and newer:
- XSD Schema Location in JOC Cockpit Configuration Directory
JETTY_BASE/resources/joc/xsd/notification/Notification_configuration_v1.0.xsd
The configuration is applied by the JS7 - Monitor Service:
inspects the workflow execution history and creates notifications as required,
- receives warnings and errors from the JOC Cockpit log files and creates related notifications,
- receives warnings and errors from the JS7 - Log Notification Service.
- Resulting notifications are displayed with the JS7 - Monitor view in the Notifications tab. They can be sent by mail and they can be processed from the command line.
- Changes to the configuration are immediately applied by the Monitor Service.
Notification View
The Configuration->Notification sub-view allows to manage the configuration like this:
Explanation:
- If this view shows an empty configuration then the "New" button can be used to created a configuration.
- Alternatively, a configuration can be added with the "Upload" button. A configuration sample is available from
- SET-212Getting issue details... STATUS .
Configuration
Structure and Elements
The configuration makes use of the following base elements, which are available from the Configurations root element.
- Fragments: Define re-usable configuration blocks for Messages, Monitors and monitored Objects.
- MessageFragments
- Message
- Defines the content which is sent, for example, by mail to a user or which is used to parameterize a command line utility, such as content to be forwarded to a System Monitor.
- Messages for use with E-Mail represent the mail body, either for use with plain text or with HTML e-mails.
- Messages for use with the Command Line represent a string that can be used with the Notifications/Notification/NotificationMonitors/CommandFragmentRef element, see below.
- Message elements can include Monitor Variables that are placeholders for values, e.g. for the Workflow Path, Order ID etc.
- Any number of Message elements can be added.
- Messages for use with E-Mail represent the mail body, either for use with plain text or with HTML e-mails.
- Defines the content which is sent, for example, by mail to a user or which is used to parameterize a command line utility, such as content to be forwarded to a System Monitor.
- MonitorFragments. These fragments come in a number of flavors for the following notifcation types.
- MailFragment
- The following elements are required to send mail:
- MessageRef: Specifies the reference to a Message element that provides the mail body.
- Subject: Specifies the mail subject and can include Monitor Variables.
- To: Specifies the e-mail address of the recipient. Multiple recipients can be separated by comma.
- The following elements are optional to send mail:
- CC: The recipient of carbon copies. Multiple recipients can be separated by comma.
- BCC: The recipient of blind carbon copies. Multiple recipients can be separated by comma.
- From: The e-mail address of the account that is used to send mail. Consider that your mail server configuration determines whether a specific or an arbitrary account can be used.
- For details see JS7 - Notifications - Configuration Element MailFragment
- The following elements are required to send mail:
- CommandFragment
- MessageRef: Specifies the reference to a Message element which provides the content that is to be forwarded with the Command element. The message content is available from the
${MESSAGE}
Monitor Variable for use with later elements. - Command: Specifies the shell command for Linux/Windows which is used to forward notifications, to, for example, a System Monitor Agent utility.
- The example notification view above makes use of a shell command like this:
echo "${MESSAGE}" >> /tmp/notification.log
- The
echo
shell command appends the content of the${MESSAGE}
Monitor Variable to a file in the/tmp
directory.
- The example notification view above makes use of a shell command like this:
- For details see JS7 - Notifications - Configuration Element CommandFragment
- MessageRef: Specifies the reference to a Message element which provides the content that is to be forwarded with the Command element. The message content is available from the
- JMSFragment
- This fragment type is used to integrate a Java Message Queue product which implements the JMS API. The values of the attributes are specific to the JMS product being used.
- For details see JS7 - Notifications - Configuration Element JMSFragment.
- NSCAFragment
- This fragment type is used for direct connections to System Monitors that operate a Nagios-compatible NSCA service for passive checks such as Nagios®, Icinga®, Opsview®. This fragment type makes use of the JSend NSCA Java API.
- The required connection attributes such as host, port, timeouts are specific to the System Monitor being used.
- Note that JSend NSCA can be used without encryption or with an XOR or TRIPLE_DES encryption. Additional encryption schemes are not supported.
- For details see JS7 - Notifications - Configuration Element NSCAFragment
- MailFragment
- ObjectFragments
- Workflows: Any umber of workflow configurations can be added and are distinguished by a unique name that is added to this element.
- Workflow: A specific workflow can be specified by, for example, its name. The path attribute allows a regular expression to specify a part of the workflow path.
- WorkflowJob: This element can be used to limit notifications to specific jobs in a workflow.
- This includes the option of specifying the job name attribute and/or its label attribute. For both attributes constant values and regular expressions can be used, for example
.*
to specify e-mail to be sent for any jobs. - For releases earlier to 2.7.1:
- It is required that the criticality, which can be one of ALL, NORMAL or CRITICAL, is specified when using this element.
- For releases starting from 2.7.1:
- The return_code_from and return_code_to attributes can be optionally used to further limit notifications to jobs which complete with the given return code. The return code for shell jobs corresponds to the OS exit code.
- This includes the option of specifying the job name attribute and/or its label attribute. For both attributes constant values and regular expressions can be used, for example
- Empty: If no WorkflowJob element is specified then the Notification applies to any JS7 - Workflow Instructions including the JS7 - Fail Instruction, otherwise it will be applied to occurrences of the JS7 - Job Instruction.
- WorkflowJob: This element can be used to limit notifications to specific jobs in a workflow.
- Workflow: A specific workflow can be specified by, for example, its name. The path attribute allows a regular expression to specify a part of the workflow path.
- Workflows: Any umber of workflow configurations can be added and are distinguished by a unique name that is added to this element.
- Message
- MessageFragments
- Notifications: Define the effective notifications by references to the Fragments elements described above.
- Notification: Any number of notifications can be added with each norification being distinguished by a unique name. A notification is assigned a type which can be any one of SUCCESS, WARNING or ERROR. This allows notifications which are used, for example, in the event of job errors and warnings to be specified. This also allows notifications to be specified for successful workflow execution. Note that successful execution includes both the absence of job errors and optionally the presence of job warnings.
- SystemNotification: Selects one or more of the above MonitorFragments. It is possible to select multiple fragments of the same fragment type.
- Such notifications are created from system errors and warnings that are identified from JOC Cockpit log files.
- NotificationMonitors: Selects one or more of the above MonitorFragments. It is possible to select multiple fragments of the same fragment type.
- CommandFragmentRef: Selects the CommandFragment to be used.
- MessageRef: Selects the Message element to be used with the Command.
- MailFragmentRef: Selects the MailFragment to be used in order to send notifications by mail. If multiple MailFragment elements are referenced then different types of mail, e.g. for different recipients or with different content and layout of the mail body can be used.
- NSCAFragmentRef: Selects the NSCAFragment to be used for direct integration with a NSCA compatible System Monitor.
- JMSFragmentRef: Selects the JMSFragment to be used to send notifications to a Java Message Queue compatible product.
- CommandFragmentRef: Selects the CommandFragment to be used.
- NotificationObjects: Selects the workflows which notifications are created for.
- WorkflowRef: Selects a Workflows element that limits notifications to their respective workflows. Any number of workflow references can be added.
- SystemNotification: Selects one or more of the above MonitorFragments. It is possible to select multiple fragments of the same fragment type.
- Notification: Any number of notifications can be added with each norification being distinguished by a unique name. A notification is assigned a type which can be any one of SUCCESS, WARNING or ERROR. This allows notifications which are used, for example, in the event of job errors and warnings to be specified. This also allows notifications to be specified for successful workflow execution. Note that successful execution includes both the absence of job errors and optionally the presence of job warnings.
Monitor Variables
- Syntax
- All variables have to be used with the following syntax, independently of the operating system in use:
${VARIABLE_NAME}
- All variables have to be used with the following syntax, independently of the operating system in use:
- Scope
- The Message element can include Monitor Variables: users can select the variable names from the below list of variables and use for example
${MON_N_CREATED}
. - The Command elements can include Operating System Variables: users have to prefix variable names from the below list with
JS7_
to use for example${JS7_MON_N_CREATED}
.
- The Message element can include Monitor Variables: users can select the variable names from the below list of variables and use for example
Common Variables
The following variables are available from the configuration and can be used with Message elements and with Command elements.
Common JOC Cockpit Variables
The following variables are available for access to JOC Cockpit and can be used with Command elements and with Message elements.
Order Notifications
Notification Variables
The following variables are available from the configuration and can be used with Message elements and with Command elements.
Order Variables
The following variables are available from orders and can be used with Message elements and with Command elements.
Order Step Variables
The following variables are available from order steps, e.g. from jobs executed with a workflow and can be used with Message elements and with Command elements.
Order Notification JOC Cockpit Variables
The following variables are available for access to JOC Cockpit and can be used with Command elements and with Message elements.
System Notifications
Notification Variables
The following variables are available for System Notifications and can be used with Command elements and with Message elements.
Logging
Processing of notifications is logged by the Monitor Service:
Further Resources
Feature
Links
How To ... Instructions
Troubleshooting