TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Setup AWS Cloudwatch Monitoring and Alerts Using Bash Scripts

39 pointsby sks147almost 4 years ago

4 comments

amirkdvalmost 4 years ago
We&#x27;ve been looking at making CloudWatch (CW) alarms an automated part of our infra. Here are some findings that may help:<p>- The semantics of CW seem convoluted. But once you stare at API docs for long enough, the core concepts are easy to grok: Metrics (regularly submitted from machine to CW), Alarms (abstractions for defining the logic of an alarm based on behavior of Metrics), and SNS Topics (could be just an email address, for what to do when an Alarm goes off).<p>- Once you get the data model right, all implementations (click ops, terraform, bash via awscli, boto3, etc) are all visibly identical.<p>- Some Metrics come for free, e.g. CPU usage is reported by any EC2 instance to CW. For some other Metrics, notably disk and memory usage, you need to configure your instance to report them to CW. This is where the OP&#x27;s monitoring scripts come in.<p>- The monitoring scripts and the cron config the OP refers to are deprecated [0]. Instead there&#x27;s a new CloudWatch Agent [1]: you install the package on your EC2 instances, provide a configuration file to it, and you&#x27;re set.<p>[0] <a href="https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;AWSEC2&#x2F;latest&#x2F;UserGuide&#x2F;mon-scripts.html" rel="nofollow">https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;AWSEC2&#x2F;latest&#x2F;UserGuide&#x2F;mon-scri...</a><p>[1] <a href="https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;AmazonCloudWatch&#x2F;latest&#x2F;monitoring&#x2F;Install-CloudWatch-Agent.html" rel="nofollow">https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;AmazonCloudWatch&#x2F;latest&#x2F;monitori...</a>
评论 #27653709 未加载
coredog64almost 4 years ago
High CPU alerts are terrible alerts. If I&#x27;m paying per instance, I <i>want</i> CPU utilization to be high. If it&#x27;s low, I&#x27;m wasting money. So now what I need is an alert where it&#x27;s not high, but somewhere between &quot;high and too high&quot;. You know, like when there&#x27;s an arbitrary spike because the Java is doing some GC. Or you have a one minute spike of traffic that fires an Ops Genie alert at 2am but auto-clears between when the on-call engineer wakes up and when they log in to check.<p>For the love of $DIETY, if you&#x27;re going to set up CloudWatch monitoring, create custom metrics that map to your business outcomes and alert when <i>those</i> go off the rails.
评论 #27657702 未加载
评论 #27654842 未加载
评论 #27656838 未加载
评论 #27654843 未加载
orfalmost 4 years ago
Not sure why you’d ever do this instead of using terraform.
评论 #27653220 未加载
评论 #27653530 未加载
评论 #27653771 未加载
评论 #27657666 未加载
评论 #27653803 未加载
rangunaalmost 4 years ago
AWS Cloudwatch Monitoring &amp; Alerts using CDK ?