Your dimensions hash is going to need to use the count index as well, otherwise Cloudwatch isnt going to know when instances to explicitly monitor. ![]() Add additional volumes by adding their mount point if needed.Ĭheck out Manually Create or Edit the CloudWatch Agent Configuration File to learn more about the available configuration parameters.Terraform code: resource "aws_cloudwatch_metric_alarm" "disk_percentage_low" -EC2Disk90%"Ĭomparison_operator = "GreaterThanOrEqualToThreshold"Īlarm_description = "This metric monitors ec2 disk utilization"Īlarm_actions = In this scenario, only the root volume / is monitored. Please note that resources allows you to select specific disks.In this scenario, we are only sending the used_percent metric for a disk. ![]() metrics_collected defines the metrics that the agent will send to CloudWatch.sudo vi /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.jsonĬopy and paste the following configuration written in JSON. Open an editor to create or edit the agent’s config file. The following instructions will guide you through the process of configuring the CloudWatch agent. sudo rpm -U amazon-cloudwatch-agent.rpmĪre you not using Amazon Linux? Check out Download and Configure the CloudWatch Agent Using the Command Line for more information. First of all, you need to download the CloudWatch agent. Next, use SSH or the Session Manager to connect with your EC2 instance. Next, you will learn how to install the CloudWatch agent. To disable alarm actions for alerts sent via SMS or email: In vSphere Client, create a folder in the Datastores and Clusters Tab. Your EC2 instance is now allowed to send CloudWatch metrics. Click the Actions button and select Modify IAM role from the Security category.Ĭhoose the IAM role you just created, ec2-monitoring in our example and click the Save button. Next, open the EC2 service and select the EC2 instance you want to monitor. But you are free tho choose your own name. We are using ec2-monitoring for this example. Search for CloudWatchAgent and select CloudWatchAgentServerPolicy from the result list. Now, you need to add permissions for CloudWatch. ![]() Next, choose AWS Servie and EC2 as the trusted entity for your IAM role and click Next. Select Roles from the sub navigation and click the Create Role button. To do so, open the AWS Management Console and go to the IAM service. ![]() Read on to learn how to monitor the disk usage of your EC2 instance! Attach IAM roleįirst, you need to grant the your EC2 access to the CloudWatch service. The next step is to create a CloudWatch alarm to monitor the disk utilization metric. After installing and configuring the CloudWatch agent on your EC2 instance, the agent will send metric data with the disk utilization to CloudWatch. Luckily, there is a simple solution to that problem: the CloudWatch agent. Alarming at the same Base Station is also triggered by the opening of any censored gate, immediately if the adult pass switch is not activated, or within 11 seconds if. The Base Station, normally located in the house, alarms when a Turtle wearer falls in the water. The reason for that, AWS - or to be more precise, the hypervisor - does know nothing about the usage of the instance store or EBS volumes linked to your EC2 instance. Safety Turtle offers two layers of protection in private and communal residences. You will not find metrics indicating the disk usage. Disk usage metric missing?īy default, AWS collects a bunch of CloudWatch metrics for every running EC2 instance.Ĭheck out List the available CloudWatch metrics for your instances for a complete listing. This blog post teaches you how to monitor the disk usage of an EC2 instance, including EBS volumes, as well as instance store. Monitoring disk usage is crucial, especially on production systems. About ten years ago, I broke my Linux laptop because I was modifying config files - /etc/passwd when I remember it correctly - while my disk was running out of space due to a data synchronization job.
0 Comments
Leave a Reply. |