· 9 years ago · Oct 04, 2016, 03:06 PM
1[ubuntu@ip-172-31-14-170:/etc/sensu/conf.d$ more disk_check.json
2{
3 "checks": {
4 "disk_check": {
5 "type": "metric",
6 "command": "check-disk-usage.rb -w 0 -c 0",
7 "subscribers": [
8 "servers"
9 ],
10 "interval": 10,
11 "handler": "mailer-ses"
12 }
13 }
14}
15
16
17
18
19[ubuntu@ip-172-31-14-170:/etc/sensu/conf.d$ more handler_ses.json
20{
21 "handlers": {
22 "mailer-ses": {
23 "type": "pipe",
24 "command": "/opt/sensu/embedded/bin/handler-mailer-ses.rb"
25 }
26 }
27}
28
29
30
31ubuntu@ip-172-31-14-170:/etc/sensu/conf.d$ more mailer-ses.json
32{
33 "mailer-ses": {
34 "mail_from": "sensu@local",
35 "mail_to": "richard@stayzill.com",
36 "access_key": "xxxxxxxx",
37 "secret_key": "xxxxxxxxxxx",
38 "aws_ses_endpoint": "email.us-west-2.amazonaws.com"
39 }
40}
41
42
43
44ubuntu@ip-172-31-14-170:/etc/sensu/conf.d$ more /opt/sensu/embedded/bin/handler-mailer-ses.rb
45#!/opt/sensu/embedded/bin/ruby
46#
47# This file was generated by RubyGems.
48#
49# The application 'sensu-plugins-mailer' is installed as part of a gem, and
50# this file is here to facilitate running it.
51#
52
53require 'rubygems'
54
55version = ">= 0.a"
56
57if ARGV.first
58 str = ARGV.first
59 str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
60 if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
61 version = $1
62 ARGV.shift
63 end
64end
65
66load Gem.activate_bin_path('sensu-plugins-mailer', 'handler-mailer-ses.rb', version)