CloudWatch u0026 CloudTrail: EC2 Monitoring Fundamentals Quiz

Explore key concepts of monitoring virtual servers using CloudWatch and CloudTrail. This quiz assesses your understanding of metrics, logs, alerts, and event tracking related to EC2 instances for effective cloud resource management.

  1. CloudWatch Basics

    Which type of monitoring enables you to view basic metrics such as CPU utilization and disk I/O for your virtual machines without extra configurations?

    1. System-level monitoring
    2. Basic monitoring
    3. User data monitoring
    4. Advanced monitoring

    Explanation: Basic monitoring provides essential metrics by default, such as CPU utilization and disk I/O, for your virtual machines. Advanced monitoring requires extra configuration and can incur additional costs, but it provides more frequent and detailed metrics. System-level monitoring is not a standard term in this context. User data monitoring refers to tracking scripts or data given to instances at launch, not performance metrics.

  2. CloudTrail Capabilities

    What is the primary purpose of CloudTrail when used in conjunction with EC2 instances?

    1. Tracking user actions and API calls
    2. Storing system logs
    3. Encrypting instance data
    4. Monitoring CPU performance

    Explanation: CloudTrail's main function is to record API calls and user activities related to EC2, making it useful for auditing and troubleshooting. It does not directly monitor CPU performance; that is a task for monitoring tools such as CloudWatch. Storing system logs refers to application or OS logging, not CloudTrail's core function. CloudTrail does not handle data encryption of instance storage.

  3. Metric Filters

    If you want to create an automatic alert when a specific error appears in EC2 logs, which CloudWatch feature should you use?

    1. Console dashboards
    2. Data pipelines
    3. Metric filters
    4. Snapshot archives

    Explanation: Metric filters allow you to scan instance logs for specific patterns, such as error codes, and generate alerts or metrics based on their presence. Data pipelines are meant for data processing and movement and do not directly interact with monitoring logs for alerts. Console dashboards visualize metrics but do not detect log patterns automatically. Snapshot archives concern backup and storage rather than monitoring log errors.

  4. Alarms and Notification

    An engineer wants to receive an email alert if an EC2 instance’s CPU utilization stays above 80% for five minutes. What should be configured?

    1. Volume snapshot
    2. CloudTrail event
    3. CloudWatch alarm
    4. Instance tagging

    Explanation: A CloudWatch alarm can monitor metrics like CPU utilization and trigger notifications if specified thresholds are met for a certain duration. CloudTrail events are used for auditing user activities, not for threshold-based resource metrics. Volume snapshots create backups but have nothing to do with alerts. Instance tagging is for organizing resources and does not trigger notifications.

  5. Retention of Events

    For how long are CloudTrail events stored by default before being rotated out if not delivered to long-term storage?

    1. 365 days
    2. 7 days
    3. 30 days
    4. 90 days

    Explanation: CloudTrail retains events for 90 days by default, allowing users to access recent logs for auditing or troubleshooting purposes. Thirty and seven days are both too short for the default window, while 365 days is much longer than the default retention period. For longer retention, you must explicitly send logs to persistent storage.

  6. Custom Metrics

    A developer needs to monitor application-level data, such as the number of processed orders each minute, on an EC2 instance. What is the most appropriate CloudWatch solution?

    1. Publishing custom metrics
    2. Assigning new instance roles
    3. Enabling basic monitoring
    4. Using system logs collection

    Explanation: Custom metrics allow you to track and report any data that is not natively collected, such as business or application activity counts. Basic monitoring only provides host and network performance metrics, not application data. System logs collection is useful for log analysis but does not convert data into metrics automatically. Assigning new instance roles does not help with metric collection.

  7. Log Collection

    Which agent should be installed on an EC2 instance to forward its operating system logs to CloudWatch Logs for centralized analysis?

    1. A log forwarding agent
    2. Connectivity analyzer
    3. Volume management driver
    4. Snapshot sync utility

    Explanation: A log forwarding agent is installed on instances to send operating system logs to CloudWatch Logs for aggregation and analysis. A volume management driver deals with disk operations, not log forwarding. Snapshot sync utilities are for backups, and a connectivity analyzer checks network paths but does not handle log forwarding.

  8. Understanding Metrics

    Which of the following is NOT a standard metric available in basic CloudWatch monitoring for virtual machines?

    1. CPU utilization
    2. Application error rate
    3. Network in
    4. Disk read operations

    Explanation: Application error rate is not a standard metric and requires implementing custom metrics, as it is specific to the application. CPU utilization, disk read operations, and network in are all standard performance metrics collected automatically. Custom methods are needed to report application-specific information like error rates.

  9. CloudTrail vs. CloudWatch

    When investigating who stopped an EC2 instance unexpectedly, which monitoring tool provides the required activity log?

    1. CloudTrail
    2. Instance metadata
    3. CloudWatch Metrics
    4. Storage events

    Explanation: CloudTrail captures actions taken on resources, such as stopping an instance, and records details about who initiated the action. CloudWatch Metrics monitors resource performance, not user actions. Instance metadata provides information about the instance itself but not about operator activities. Storage events are related to data storage changes, not instance control operations.

  10. Configuring Dashboards

    What is the main advantage of creating a monitoring dashboard for EC2 in CloudWatch?

    1. Launching automatic backups
    2. Visualizing multiple metrics in a single view
    3. Encrypting all traffic
    4. Increasing instance memory

    Explanation: Dashboards provide a consolidated visual display of various resource metrics, facilitating easy and quick monitoring. They do not encrypt traffic; network encryption is handled separately. Increasing instance memory involves resizing the instance, not changing dashboards. Automatic backups pertain to data protection features, not visual monitoring.