350-401 · Question #416
Refer to the exhibit. An engineer must create a script that appends the output of the show process cpu sorted command to a file. Which action completes the configuration?
The correct answer is B. action 4.0 cli command "show process cpu sorted | append flash:high-cpu-file". To append the output of a show process cpu sorted command to a file using Cisco EEM, the action cli command is the correct method.
Question
Exhibits
Options
- Aaction 4.0 syslog command "show process cpu sorted | append flash:high-cpu-file"
- Baction 4.0 cli command "show process cpu sorted | append flash:high-cpu-file"
- Caction 4.0 ens-event "show process cpu sorted | append flash:high-cpu-file"
- Daction 4.0 publish-event "show process cpu sorted | append flash:high-cpu-file"
How the community answered
(71 responses)- A7% (5)
- B73% (52)
- C3% (2)
- D17% (12)
Why each option
To append the output of a `show process cpu sorted` command to a file using Cisco EEM, the `action cli command` is the correct method.
The `syslog` action in EEM is used for generating and sending syslog messages to a logging server or local buffer, not for executing arbitrary CLI commands on the device.
In Cisco Embedded Event Manager (EEM), the `action cli command` keyword is used to execute any standard IOS or IOS-XE command-line interface command, including those with redirection operators like `| append`, which allows the script to gather and append command output to a specified file on the device's flash memory.
`ens-event` is not a recognized or standard EEM action keyword for executing CLI commands; EEM actions are well-defined and follow specific syntaxes.
`publish-event` is not a recognized or standard EEM action keyword for executing CLI commands; EEM actions are well-defined and follow specific syntaxes.
Concept tested: Cisco EEM CLI command execution
Source: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/eem/configuration/xe-3se/eem-xe-3se-book/eem-cli.html
Topics
Community Discussion
No community discussion yet for this question.

