amazon-cloudwatch

How can I use AWS Boto3 to get Cloudwatch metric statistics?

核能气质少年 提交于 2020-08-24 08:18:22
问题 I'm working on a Python 3 script designed to get S3 space utilization statistics from AWS CloudFront using the Boto3 library. I started with the AWS CLI and found I could get what I'm after with a command like this: aws cloudwatch get-metric-statistics --metric-name BucketSizeBytes --namespace AWS/S3 --start-time 2017-03-06T00:00:00Z --end-time 2017-03-07T00:00:00Z --statistics Average --unit Bytes --region us-west-2 --dimensions Name=BucketName,Value=foo-bar Name=StorageType,Value

Trigger AWS CloudWatch Event Manually

假如想象 提交于 2020-07-18 07:11:25
问题 I have a event in CloudWatch, which is triggered once a day. Is there a way to trigger the event manually (for testing purposes)? ...I realize I can increase the frequency of the event's triggering schedule. 回答1: If you have a cloudwatch alarm set up, using the AWS CLI you can, for testing purposes, set the alarm state of that alarm: aws cloudwatch set-alarm-state --alarm-name "myalarm" --state-value ALARM --state-reason "testing purposes" see the docs here Alternatively you can put a custom

Logs not getting sent to AWS Cloudwatch when docker in detached or foreground

℡╲_俬逩灬. 提交于 2020-07-06 11:50:32
问题 When I run the docker script in interactive mode it works. I can see the logs in the console and also in AWS CloudWatch Logs. The below docker script runs in interactive mode and I have added the awslogs configuration so the logs go into cloudwatch. docker awslogs configuration docker run --rm -i -t --log-driver awslogs \ --log-opt awslogs-region=us-east-1 \ --log-opt awslogs-group=falcoint \ --log-opt awslogs-create-group=true \ --privileged \ -v /dev:/host/dev \ -v /proc:/host/proc:ro \ -v

Logs not getting sent to AWS Cloudwatch when docker in detached or foreground

僤鯓⒐⒋嵵緔 提交于 2020-07-06 11:50:10
问题 When I run the docker script in interactive mode it works. I can see the logs in the console and also in AWS CloudWatch Logs. The below docker script runs in interactive mode and I have added the awslogs configuration so the logs go into cloudwatch. docker awslogs configuration docker run --rm -i -t --log-driver awslogs \ --log-opt awslogs-region=us-east-1 \ --log-opt awslogs-group=falcoint \ --log-opt awslogs-create-group=true \ --privileged \ -v /dev:/host/dev \ -v /proc:/host/proc:ro \ -v

How to monitor EC2 instances by memory?

余生长醉 提交于 2020-06-25 09:36:09
问题 Using Cloudwatch you can monitor your EC2 instances by several criteria, such as network usage, CPU usage, and so on… Unfortunately, there is no metric for memory consumption. First of all, just out of curiosity, I would like to know, why? Can anybody explain why it is possible to, e.g., monitor CPU usage, but not memory usage? At least to me, that's not obvious. And then, my actual question: Okay, given that Cloudwatch doesn't allow monitoring the EC2 instances' memory usage - what is the