LoginSignup
0

More than 5 years have passed since last update.

AWSで高価なインスタンスの落とし忘れをなくす

Posted at

結論

(local--dayo)$ ssh (対象サーバー)
(server-dayo)$ crontab -e
# 次の内容を追加
0,5,10,15,20,25,30,35,40,45,50,55 * * * * curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"shinde nai yo!:\\n `vmstat`\"}" https://hooks.slack.com/services/$YOUR_API_KEY

タイトルはやや釣りでした。すみません。AWSである必要はありません。
とても原始的だけど、とても効果があると思いました。
ちょっと重めの処理を走らせているので、ついでにvmstatでメモリの推移とか色々見ています。
ansibleで入れたzabbixでやれとか言わないで

その他の方法

  • 適当なIAMを使って、一定時間特定のプロセスが生きていなかったらころす
  • billing alarmとかをつかう

エバンジェリストの方によると、
http://yoshidashingo.hatenablog.com/entry/2014/09/04/100548

個人的には、機械的に殺すとやっぱり万一の時にイラっとするので、適切なアラートを飛ばすぐらいでよいのかなと

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0