You must monitor a specific process running on Linux EC2 instances and ensure that if the process stops, it is automatically restarted. The CloudWatch agent is already deployed on all instances. Which configuration will provide process monitoring and automated restarts?
Choose an answer
Tap an option to check your answer.
Correct answer: Configure the CloudWatch agent with a procstat monitor for the process and create an EventBridge rule that triggers an AWS Systems Manager Automation runbook to restart the process when it stops..
Why this is the answer
The correct option leverages the CloudWatch agent's procstat plugin, which is specifically designed to monitor processes on Linux instances, including their status (running or stopped). When the procstat plugin detects that the process has stopped, it can publish a custom metric to CloudWatch. An Amazon EventBridge rule can then be configured to detect a specific metric value (e.g., process count equals zero) or a custom event indicating the process has stopped. This rule can directly trigger an AWS Systems Manager Automation runbook to execute commands on the EC2 instance to restart the process. Incorrect options: Using a StatsD monitor is incorrect because StatsD is primarily for collecting custom application metrics, not for monitoring the state of system processes like procstat. While a CloudWatch alarm can be triggered by metrics, an EventBridge rule offers more flexibility and direct integration with Systems Manager Automation for event-driven actions, especially when dealing with custom metrics published by the CloudWatch agent. An EventBridge rule can react to specific metric values or events, making it a suitable choice for this scenario.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed