Custom metric automatically stop giving data aftersometime

0

{ "metrics": { "append_dimensions": { "InstanceId": "${aws:InstanceId}" }, "metrics_collected": { "LogicalDisk": { "measurement": [ "Free Megabytes", "Used Megabytes" ], "resources": [ "*" ] }, "Memory": { "measurement": [ "Available MBytes", "Committed Bytes" ], "metrics_collection_interval": 60 } } } } I have applied this custom script for cloudwatch.this script is running in n virginia region . But my cloudwatch stops giving data after sometime . Please help

saini
asked a month ago66 views
1 Answer
0

Hello,

The issue you're experiencing with CloudWatch not sending metrics to CloudWatch after some time can be due to several reasons. Here's some steps you can follow to troubleshoot and resolve the problem:

1.CloudWatch Agent Configuration:

  • Ensure that the CloudWatch agent configuration file is correctly set up.
  • Ensure the configuration file path and syntax are correct.

2.CloudWatch Agent Service:

  • Verify that the CloudWatch agent service is running on your instance.
  • Restart the CloudWatch agent service if it has stopped.

Stop and restart Cloud Watch agent

3.Permissions:

  • Ensure the IAM role attached to the EC2 instance has the necessary permissions to write metrics to CloudWatch.
  • The policy should include permissions for cloudwatch:PutMetricData.

Documentation for permission policies that must be attached to EC2: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-iam-roles-for-cloudwatch-agent-commandline.html

4.Logs and Errors:

Check the CloudWatch agent logs for any errors or warnings that might indicate why the data collection has stopped.

This file is located in /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log on Linux servers and in $Env:ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log on servers running Windows Server.

Refer: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/troubleshooting-CloudWatch-Agent.html#CloudWatch-Agent-troubleshooting-loginfo

Troubleshooting the Cloud Watch agent

profile picture
EXPERT
answered a month ago
profile picture
EXPERT
reviewed 25 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions