350-601 · Question #334
Refer to the exhibit. An engineer must configure Embedded Event Manager to output a message to syslog when the Cisco IOS write memory CLI command runs. Which command completes the script?
The correct answer is A. event cli pattern "write memory.*" sync yes. To configure Embedded Event Manager (EEM) to detect the execution of the Cisco IOS write memory command and output a syslog message, the event cli pattern command must be used.
Question
Refer to the exhibit. An engineer must configure Embedded Event Manager to output a message to syslog when the Cisco IOS write memory CLI command runs. Which command completes the script?
Options
- Aevent cli pattern "write memory.*" sync yes
- Bevent cli match "write memory.*" sync yes
- Cevent cli regex "write memory.*" sync yes
- Devent cli command "write memory.*" sync yes
How the community answered
(43 responses)- A91% (39)
- B2% (1)
- C5% (2)
- D2% (1)
Why each option
To configure Embedded Event Manager (EEM) to detect the execution of the Cisco IOS write memory command and output a syslog message, the event cli pattern command must be used.
The event cli pattern 'write memory.*' sync yes command configures an EEM event detector to trigger when a CLI command matching the specified regular expression, 'write memory.*', is executed. The pattern keyword is specifically used for regular expression matching of CLI commands within EEM.
The match keyword is not the standard or correct EEM CLI event parameter for defining a regular expression pattern to detect a command.
While regex refers to regular expressions, event cli regex is not the correct EEM command syntax for defining a CLI command pattern; the correct keyword is pattern.
The command keyword in EEM event cli is used to match an exact command string, not a regular expression pattern.
Concept tested: EEM CLI event detection
Source: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/eem/configuration/15-mt/eem-15-mt-book/eem-cli-events.html
Topics
Community Discussion
No community discussion yet for this question.