简体   繁体   English

AWS SES或SNS,用于监视EC2实例中程序的变量

[英]AWS SES or SNS for monitoring variables for program within EC2 instance

Instead of having to log into my instance to check the logs, I would like to implement the ability to be notified whenever a variable within my program goes below a certain point. 无需登录到我的实例来检查日志,我想实现在程序中的变量低于某个特定点时得到通知的功能。

It looks like AWS SES would be the easiest since I tell it exactly when to notify me but it looks like I have to set the sender and receiver emails to be the same which doesn't seem very professional. 看来AWS SES是最简单的方法,因为我准确告知了何时通知我,但看来我必须将发送者和接收者电子邮件设置为相同,这似乎不太专业。

AWS SNS is perfect but doesn't seem like I have it monitor variables within my application. AWS SNS是完美的,但似乎没有在应用程序中监视它的变量。 Seems to good for monitoring my EC2 instances. 似乎对监视我的EC2实例很好。

I'm confused which would be best for my case. 我很困惑,这对我来说是最好的。

SES is primarily for sending out bulk emails. SES主要用于发送大量电子邮件。 For your use case SNS is the perfect option if you want to do more than just receiving email. 对于您的用例,如果您想做的不仅仅是接收电子邮件,还可以使用SNS。

Basically you can create a cloudwatch matrix for your variable and then create a cloudwatch alarm based on that matrix. 基本上,您可以为变量创建一个cloudwatch矩阵 ,然后基于该矩阵创建一个cloudwatch警报

Now you can either enter your email id in the notification for this alarm or you can have this alarm notify an SNS topic and then you subscribe your email address to this SNS Topic. 现在,您可以在此警报的通知中输入您的电子邮件ID,也可以让此警报通知SNS主题,然后为该SNS主题订阅电子邮件地址。

However the 2nd option of SNS would be more meaningful if you want to take some auto correcting measure (maybe by invoking Lambda). 但是,如果您要采取一些自动更正措施(例如通过调用Lambda),SNS的第二个选项将更有意义。 If you just want to be notified then you can go with option 1 and not unnecessarily use SNS 如果您只想收到通知,则可以选择选项1,而不必使用SNS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM