Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

SLAX and XSLT Commit Script Tag Elements to Use When Generating Messages

 

Junos OS commit scripts can generate custom warning, error, or system log messages during a commit operation to alert you when the configuration does not comply with custom configuration rules. Table 1 summarizes the tag elements that you can include in a custom warning, error, or system log message in SLAX and XSLT commit scripts.

Table 1: Tags and Attributes for Creating Custom Warning, Error, and System Log Messages

Data Item, XML Element, or Attribute

Required or Supported

Description

Container Tags and Attributes

<syslog>

Required for system log messages

Indicates that a system log message is going to be recorded.

<xnm:error>

Required for error messages

Indicates that the server has encountered a problem while processing the client application’s request.

<xnm:warning>

Required for warning messages

Indicates that the server has encountered a problem while processing the client application’s request.

xmlns url

Supported in warning and error messages

Names the XML namespace for the contents of the tag element. The value is a URL of the form http://xml.juniper.net/xnm/version/xnm, where version is a string such as 1.1.

xmlns:xnm url

Required for warning and error messages. The xmlns:xnm element is included in the script boilerplate, which sets the namespace globally.

Names the XML namespace for child tag elements that have the xnm: prefix on their names. The value is a URL of the form http://xml.juniper.net/xnm/version/xnm, where version is a string such as 1.1.

Content Tags

<column>

Supported in warning and error messages only

Identifies the element that caused the error by specifying its position as the number of characters after the first character in the line specified by the <line-number> tag element in the configuration file that was being loaded (which is named in the <filename> tag element). We recommend combining the <column> tag with the <line-number> and <filename> tags.

<database-status-information>

Supported in error messages only

Provides information about the users currently editing the configuration.

<edit-path>

Supported in warning and error messages only

Specifies the level in the configuration hierarchy where the problem occurred, using the CLI configuration mode banner. We recommend combining the <edit-path> tag with the <statement> tag.

<filename>

Supported in warning and error messages only

Names the configuration file that was being loaded.

<line-number>

Supported in warning and error messages only

Specifies the line number where the error occurred in the configuration file that was being loaded, which is named by the <filename> tag element. We recommend combining the <line-number> tag with the <column> and <filename> tags.

<message>

Required in warning, error, and system log messages

Describes the warning, error, or system log message in a natural-language text string.

<parse/>

Supported in error messages only

Indicates that there was a syntactic error in the request submitted by the client application.

<reason>

Supported in warning and error messages only

Describes the reason for the warning or error message.

<re-name>

Supported in warning and error messages only

Names the Routing Engine on which the process named by the <source-daemon> tag element is running.

<source-daemon>

Supported in warning and error messages only

Names the Junos OS module that was processing the request in which the warning or error message occurred.

<statement>

Supported in warning and error messages only

Specifies the configuration statement in effect when the problem occurred. We recommend combining the <statement> tag with the <edit-path> tag.

<token>

Supported in warning and error messages only

Names the element in the request that caused the warning or error message.

<xsl:call-template name="jcs:edit-path">

Supported in warning and error messages only

Emits an <edit-path> element, which specifies the CLI configuration mode edit path in effect when the warning or error was generated.

If the problem is not at the current position in the XML hierarchy, you can alter the edit path by passing the dot parameter. For example, <xsl:param name="dot" select="system/ports/console"/> changes the edit path to [edit system ports console].

<xsl:call-template name="jcs:statement">

Supported in warning and error messages only

Emits a <statement> element, which describes the configuration statement in effect when the warning or error was generated.

If the problem is not at the current position in the XML hierarchy, you can alter the statement by passing the dot parameter. For example, <xsl:with-param name="dot" select="system/ports/console/type"/> changes the statement to type.

For examples that use the tags to generate warnings, errors, and system log messages, see: