TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Setup AWS Cloudwatch Monitoring and Alerts Using Bash Scripts

39 点作者 sks147将近 4 年前

4 条评论

amirkdv将近 4 年前
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 未加载
coredog64将近 4 年前
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 未加载
orf将近 4 年前
Not sure why you’d ever do this instead of using terraform.
评论 #27653220 未加载
评论 #27653530 未加载
评论 #27653771 未加载
评论 #27657666 未加载
评论 #27653803 未加载
ranguna将近 4 年前
AWS Cloudwatch Monitoring &amp; Alerts using CDK ?