amazon-cloudwatch

How do I get the most recent Cloudwatch metric data for an instance using Boto?

情到浓时终转凉″ 提交于 2019-12-09 04:16:37
问题 I'm trying to get the most recent data for CPU utilization for an instance (actually, several instances, but just one to start with), however the following call doesn't return any data: cw = boto.cloudwatch.connect_to_region(Region) cw.get_metric_statistics( 300, datetime.datetime.now() - datetime.timedelta(seconds=600), datetime.datetime.now(), 'CPUUtilization', 'AWS/EC2', 'Average', dimensions={'InstanceId':['i-11111111']} # for stats across multiple instances: # dimensions={'InstanceId':[

Binary Output from Google Script HMAC encription

不羁岁月 提交于 2019-12-08 21:36:38
问题 I am current working with Google Apps script and am attempting to write & sign an HTTP request to AWS CloudWatch. On the Amazon API documentation here regarding how to create a signing key, they use pseudo to explain that the HMAC algorithm is to return binary format. HMAC(key, data) represents an HMAC-SHA256 function that returns output in binary format. Google apps script offers a method to do such a hash, Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_256, data, key); but

AWS Cloud watch alarm, triggering autoscaling using multiple metrics

点点圈 提交于 2019-12-08 17:22:35
问题 I want to create a cloud watch alarm which triggers autoscaling based on more than one metric data. Since this is not natively supported by Cloud Watch ( Correct me if i am wrong ). I was wondering how to overcome this. Can we get the data from different metrics, say CPUUtilization, NetworkIn, NetworkOut and then create a custom metrics using mon-put-data and enter these data to create a new metric based on which to trigger an autoscaling ? 回答1: Yes .. Cloudwatch Alarms can only trigger on a

AWS CloudWatch Alarms to multiple EC2 instances

∥☆過路亽.° 提交于 2019-12-08 14:59:26
问题 I'm wanting to apply a CloudWatch alarm to stop instances which aren't being used in our pre-production environment. We often have instances being spun up, used and then left turned on which is really starting to cost us a fair amount of money. CloudWatch alarms have a handy feature whereby we can stop based on some metrics - this is awesome and what I'd like to use to constantly keep an eye on the servers with but let it tidy up the instances for me. The problem with this is that it appears

How to restart EC2 instance from CloudWatch alarm

南笙酒味 提交于 2019-12-07 19:39:47
问题 Sometimes my application dies w/o any reason and I can detect that using CloudWatch and CPU usage metric going down. At this moment I want to restart the java application or the whole EC2 instance. Any suggestions how can I achive that? 回答1: You can let CloudWatch terminate your EC2 instance and let AutoScaling bring up another "fresh" instance with your application configured. 回答2: AWS CloudWatch now provides a reboot EC2 instance action. 回答3: If only your application halt but EC2 instance

What AWS CloudWatch Logs are using for storage?

爱⌒轻易说出口 提交于 2019-12-07 15:36:31
I started working with amazon CloudWatch Logs . The question is, are AWS using Glacier or S3 to store the logs? They are using Kinesis to process the logs using filters. Can anyone please tell the answer? They are probably using DynamoDB. S3 (and Glacier) would not be good for files that are appended to on a very frequent basis. AWS is likely to use S3, not Glacier. Glacier would make problems if you would want access older logs as to get data stored in Amazon Glaciers can take few hours and this is definitely not the reaction time one expects from CloudWatch log analysing solution. Also the

How to fetch the CloudWatch metrics data for EC2 instances

╄→гoц情女王★ 提交于 2019-12-07 09:20:01
问题 I want to fetch the Cloudmetrics data for my EC2 instance so that I can draw graphs using those data and display it on my android device. How do I do that? Is there any sample program or tutorial for the same? Thanks in advance. This is what I am doing: private static void findCloudWatchData() { AmazonCloudWatchClient cloudWatch = new AmazonCloudWatchClient(new BasicAWSCredentials(AccessKey, SecretKey)); cloudWatch.setEndpoint("monitoring.us-east-1.amazonaws.com"); long offsetInMilliseconds =

Can a CloudWatch alarm be defined for a metric over many dimensions

谁说胖子不能爱 提交于 2019-12-07 07:05:10
问题 I'm using python and boto for cloudwatch metrics. I would like to be able to define an alarm for a MetricName which will be active for all the other dimensions. For instance I have a metric in the sandbox namespace with MetricName of MemoryUsage and InstanceId of i-xxx . Is it possible to define a single alarm that will be triggered for MemoryUsage for all InstanceId dimensions? 回答1: Yes, you can create an alarm for any single metric. In this case, the single metric has a dimension that

Springboot with Spring-cloud-aws and cloudwatch metrics

不羁的心 提交于 2019-12-07 04:11:22
问题 I would like to start using metrics in my Springboot app and I would also like to publish them my amazon cloudwatch I know that with Springboot we can activate spring-actuator that provides in memory metrics and published them to the /metrics endpoint. I stumbled across Spring-cloud that seems to have some lib to periodically publish these metrics to Cloudwatch, however I have no clue how to set them up? There is absolutely 0 examples of how to use it. Anyone could explain what are the step

Can I use AWS LightSail with AWS CloudWatch?

守給你的承諾、 提交于 2019-12-07 03:11:51
问题 I've recently started testing out LightSail, but I would like to keep my logging centralized in CloudWatch, but cannot seem to find anything that would enable this. Interestingly LightSail instances do not appear in the EC2 Dashboard. I thought they were just EC2 instances beneath the surface. 回答1: I thought they were just EC2 instances beneath the surface. Yes... but. Conceptually speaking, you are the customer of Lightsail, and Lightsail is the customer of EC2. It's as though there were an