trigger

This command creates an event trigger.

Syntax

trigger message-ID [expression] only-once only-this-trigger command

no trigger message-ID [expression] only-once only-this-trigger command

Parameters

message-ID
Specifies the message identifier that will, when logged, trigger the command.
expression
Optionally specifies a regular expression that must match the body of the message to trigger the command.
only-once
Indicates the behavior when the trigger criteria are met more than one time.
on
This command is triggered only the first time that the trigger criteria are met.
off
This command is triggered each time that the trigger criteria are met. This setting is the default value.
only-this-trigger
Indicates how other event triggers behave that have the same trigger criteria.
on
This command is triggered, but other commands that would be triggered by the same message ID are not. This setting is the default value.
off
Subsequent event triggers, that share this message ID, are also triggered.
command
The command that runs when the trigger criteria are met. Commands must be separated by semicolons. If the command contains a space, enclose the value in double quotation marks.

Guidelines

Use the event trigger to run specific commands when specific messages appear in the system logs.

Examples

  • Start a packet capture when the specified message is logged. The only-once parameter is set to on so that multiple packet captures are not initiated. The only-this-trigger parameter is set to on so that the stop packet capture command is not triggered immediately.
    # trigger "0x99999" "" on on "interface eth10; packet-capture
        temporary:///capture -1 250"
    #
    
  • Stop the packet capture.
    # trigger "0x99999" "" on on "interface eth10; no packet-capture
        temporary:///capture"
    #