NCP-MCA · Question #18
An administrator has a vendor-provided script that must be run at 9 am every Saturday on a Linux application VM. The administrator currently has a playbook that has a Time trigger and a VM SSH…
The correct answer is D. Add an Email action to the end of the existing playbook and use the {{action[index] .stdout}}. The easiest way to satisfy the request is to add an Email action to the end of the existing playbook and use the {{action[index] .stdout}} parameter in the Message field. This way, the administrator does not need to modify the script or create a file to store the output. The…
Question
An administrator has a vendor-provided script that must be run at 9 am every Saturday on a Linux application VM. The administrator currently has a playbook that has a Time trigger and a VM SSH action to execute the script. However, the administrator has received a request to have the output of the script emailed to the application team when it is executed. What is the easiest way to satisfy this request?
Options
- AModify the script to include a function to format the output of the script and email the output to the
- BAdd an Email action to the end of the existing playbook and use the {{action
- CDirect the output of the script to a file and use the Send Email with Payload action at the end of
- DAdd an Email action to the end of the existing playbook and use the {{action[index] .stdout}}
How the community answered
(31 responses)- A6% (2)
- B3% (1)
- C10% (3)
- D81% (25)
Explanation
The easiest way to satisfy the request is to add an Email action to the end of the existing playbook and use the {{action[index] .stdout}} parameter in the Message field. This way, the administrator does not need to modify the script or create a file to store the output. The {{action[index] .stdout}} parameter will capture the standard output of the previous action, which is the VM SSH action that executes the script. The Email action will then send the output as the message body to the specified recipients.
Topics
Community Discussion
No community discussion yet for this question.