3.2.11. trigger

Top-lever container for trigger.

vsr running config# system trigger

enabled

Enable or disable the triggers.

vsr running config# system trigger
vsr running trigger# enabled true|false
Default value
true

event

Set an event to trigger either on alarm, on resource, or on cron.

vsr running config# system trigger event <string>

<string>

Set the name of the event.

enabled

Enable the event.

vsr running config# system trigger event <string>
vsr running event <string># enabled true|false
Default value
true

log

Log the event when it is triggered.

vsr running config# system trigger event <string>
vsr running event <string># log true|false
Default value
false

user

Set the user executing the commands.

vsr running config# system trigger event <string>
vsr running event <string># user USER

USER

A user name.

commands (mandatory)

Set the cli commands that will be run when the event is triggered.

vsr running config# system trigger event <string>
vsr running event <string># commands <string>

on-alarm

Trigger an event when an alarm is raised.

vsr running config# system trigger event <string> on-alarm

alarm

Set the name of the alarm that will trigger the event.

vsr running config# system trigger event <string> on-alarm
vsr running on-alarm# alarm <leafref>

severity-level

Set the severity that will trigger the event when reached.

vsr running config# system trigger event <string> on-alarm
vsr running on-alarm# severity-level SEVERITY-LEVEL

SEVERITY-LEVEL values

Description

indeterminate

Indicates that the severity level could not be determined. This level SHOULD be avoided.

warning

The ‘warning’ severity level indicates the detection of a potential or impending service-affecting fault, before any significant effects have been felt. Action should be taken to further diagnose (if necessary) and correct the problem in order to prevent it from becoming a more serious service-affecting fault.

minor

The ‘minor’ severity level indicates the existence of a non-service-affecting fault condition and that corrective action should be taken in order to prevent a more serious (for example, service-affecting) fault. Such a severity can be reported, for example, when the detected alarm condition is not currently degrading the capacity of the resource.

major

The ‘major’ severity level indicates that a service- affecting condition has developed and an urgent corrective action is required. Such a severity can be reported, for example, when there is a severe degradation in the capability of the resource and its full capability must be restored.

critical

The ‘critical’ severity level indicates that a service- affecting condition has occurred and an immediate corrective action is required. Such a severity can be reported, for example, when a resource becomes totally out of service and its capability must be restored.

on-resource

Trigger an event when a pushed state leaf is updated.

vsr running config# system trigger event <string> on-resource

resource (mandatory)

Set the resource of the trigger. The resource must be pushed state with the /state prefix. Example: /system/troubleshooting-report.

vsr running config# system trigger event <string> on-resource
vsr running on-resource# resource RESOURCE

RESOURCE values

Description

<xpath1.0>

This type represents an XPATH 1.0 expression. When a schema node is defined that uses this type, the description of the schema node MUST specify the XPath context in which the XPath expression is evaluated.

<object-identifier>

The object-identifier type represents administratively assigned names in a registration-hierarchical-name tree. Values of this type are denoted as a sequence of numerical non-negative sub-identifier values. Each sub-identifier value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers are separated by single dots and without any intermediate whitespace. The ASN.1 standard restricts the value space of the first sub-identifier to 0, 1, or 2. Furthermore, the value space of the second sub-identifier is restricted to the range 0 to 39 if the first sub-identifier is 0 or 1. Finally, the ASN.1 standard requires that an object identifier has always at least two sub-identifiers. The pattern captures these restrictions. Although the number of sub-identifiers is not limited, module designers should realize that there may be implementations that stick with the SMIv2 limit of 128 sub-identifiers. This type is a superset of the SMIv2 OBJECT IDENTIFIER type since it is not restricted to 128 sub-identifiers. Hence, this type SHOULD NOT be used to represent the SMIv2 OBJECT IDENTIFIER type; the object-identifier-128 type SHOULD be used instead.

<string>

This type is used to match resources of type ‘resource’. Since the type ‘resource’ is a union of different types, the ‘resource-match’ type is also a union of corresponding types. If the type is given as an XPath 1.0 expression, a resource of type ‘instance-identifier’ matches if the instance is part of the node set that is the result of evaluating the XPath 1.0 expression. For example, the XPath 1.0 expression: /ietf-interfaces:interfaces/ietf-interfaces:interface [ietf-interfaces:type=’ianaift:ethernetCsmacd’] would match the resource instance-identifier: /if:interfaces/if:interface[if:name=’eth1’], assuming that the interface ‘eth1’ is of type ‘ianaift:ethernetCsmacd’. If the type is given as an object identifier, a resource of type ‘object-identifier’ matches if the match object identifier is a prefix of the resource’s object identifier. For example, the value: 1.3.6.1.2.1.2.2 would match the resource object identifier: 1.3.6.1.2.1.2.2.1.1.5 If the type is given as an UUID or a string, it is interpreted as an XML Schema regular expression, which matches a resource of type ‘yang:uuid’ or ‘string’ if the given regular expression matches the resource string. If the type is given as an XPath expression, it is evaluated in the following XPath context: o The set of namespace declarations is the set of prefix and namespace pairs for all YANG modules implemented by the server, where the prefix is the YANG module name and the namespace is as defined by the ‘namespace’ statement in the YANG module. If a leaf of this type is encoded in XML, all namespace declarations in scope on the leaf element are added to the set of namespace declarations. If a prefix found in the XML is already present in the set of namespace declarations, the namespace in the XML is used. o The set of variable bindings is empty. o The function library is the core function library, and the functions are defined in Section 10 of RFC 7950. o The context node is the root node in the data tree.

above

The alarm will be triggered if the value is above.

vsr running config# system trigger event <string> on-resource
vsr running on-resource# above <int64>

below

The alarm will be triggered if the value is below.

vsr running config# system trigger event <string> on-resource
vsr running on-resource# below <int64>

equal

The alarm will be triggered if the value is equal.

vsr running config# system trigger event <string> on-resource
vsr running on-resource# equal EQUAL

EQUAL values

Description

<int64>

No description.

<string>

No description.

true|false

No description.

different

The alarm will be triggered if the value is different.

vsr running config# system trigger event <string> on-resource
vsr running on-resource# different DIFFERENT

DIFFERENT values

Description

<int64>

No description.

<string>

No description.

true|false

No description.

between

The alarm will be triggered if the value is between start and end.

vsr running config# system trigger event <string> on-resource between
start

Set the start value.

vsr running config# system trigger event <string> on-resource between
vsr running between# start <int64>
end

Set the end value.

vsr running config# system trigger event <string> on-resource between
vsr running between# end <int64>

on-cron

Trigger an event periodically.

vsr running config# system trigger event <string> on-cron

cron

Set the cron format of the event. Example: “* 3 * * *” (every day at 3 AM).

vsr running config# system trigger event <string> on-cron
vsr running on-cron# cron m h dom mon dow