What will occur when a user enters a lowercase y at the prompt? (Select the best answer.)

Last Updated on August 7, 2021 by Admin 3

You issue the following commands:

350-401 Part 04 Q06 045
350-401 Part 04 Q06 045

What will occur when a user enters a lowercase y at the prompt? (Select the best answer.)

  • The configure terminal command will be executed, and the router will be placed into globalconfiguration mode.
  • The configure terminal command will not be executed, because the EEM applet requires anuppercase Y.
  • The configure terminal command will not be executed, because the EEM applet is missing the set 9_exit_status 0 command.
  • The configure terminal command will not be executed, because the event cli command should usethe sync no keywords.
Explanation:
The configure terminal command will not be executed, because the Embedded Event Manager (EEM) applet requires an uppercase Y. The event cli command configures EEM to monitor commandline interface (CLI) commands and to trigger the event when a specified pattern is matched one or more times. The action command indicates the action that should take place. Actions are sorted based on the alphanumeric label, which is issued after the action keyword. The action string match command compares two values? if the values match, EEM sets the $_string_result variable to a value of 1, and if the values do not match, EEM sets the $_string_result variable to a value of 0. The action if command checks a condition? if the condition is true, the actions before the action end command are performed, and if the condition is false, the actions after the action end command are performed.
The action string match command is casesensitive. To force a caseinsensitive comparison, you can issue the action string match command with the nocase keyword. For example, the action 4 string match nocase “$answer” “Y” command would accept an uppercase Y or a lowercase y as a match. Alternatively, you can issue the action string tolower command to store a variable in lowercase or the action string touppercommand to store a variable in uppercase. For example, the following command set would store a lowercase y as an uppercase Y, effectively forcing a caseinsensitive comparison:

350-401 Part 04 Q06 046
350-401 Part 04 Q06 046

When a user enters a lowercase y at the prompt, the string toupper command will store the answer in $_string_result as an uppercase Y. The strings are compared, and because they match, the router is placed into global configuration mode.
The EEM applet is not missing the set 9 _exit_status 0 command. The sync yeskeywords are used with the event cli command to configure synchronous processing. With synchronous processing, the EEM applet must finish before the CLI command can be executed, and the _exit_status variable determines whether the CLI command is executed or skipped. If the _exit_status variable is set to a value of 0 or is not configured, the CLI command will not execute after the EEM applet is finished; if the _exit_status variable is set to a value of 1, the CLI command will execute after the EEM applet is finished. Therefore, the set 9 _exit_status 0 command would not cause the configure terminal command to be executed. If the set 9 _exit_status 1 command were issued in this scenario, the configure terminal command would be executed after the applet is finished, regardless of what answer the user provided.
Issuing the sync no keywords in the event cli command would not cause the configure terminal command to be executed unless the skip no keywords were also issued. The sync no keywords are used with the event cli command to configure asynchronous processing. With asynchronous processing, the EEM applet is processed at the same time the CLI command is executed. When you issue the event cli command with the sync nokeywords, you must also include the skip no or skip yes keywords to indicate whether the CLI command should be executed or skipped, respectively. If you were to issue the event cli pattern “configure terminal” sync no skip yes command in this scenario, the configure terminal command would not be executed unless the user enters an uppercase Y at the prompt. If you were to issue the event cli pattern “configure terminal” sync no skip yes command, the configure terminal command would be executed immediately, regardless of what answer the user provided.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments