sensu-plugins-mailhandler 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/mailhandler.rb +10 -10
- data/lib/sensu-plugins-mailhandler/version.rb +1 -1
- data/sensu-plugins-mailhandler.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2057c685440ab00bdedd71eb7e8f7d1afe91061f
|
4
|
+
data.tar.gz: 27d931d6e58dca9e6e42583be94d4ddf704cdf4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dddcc8e3c0753d128cb860125e36b026911943613a771e7b99dbb3eb5c963595fb84b8e42adc4667187b66cdae9e40a4896047cee802e40ef4c6b6b154d678c2
|
7
|
+
data.tar.gz: 8480fdd9d537739314bbbd79dd4f10c5a6ee5cce539a966c9f2a76e358314da349c3918bd27b1a840bcfc08bd72178dcaf55c4f599439d9a29261d38ba5cb0a8
|
data/bin/mailhandler.rb
CHANGED
@@ -83,19 +83,19 @@ class Mailhandler < Sensu::Handler
|
|
83
83
|
long: '--to recipient',
|
84
84
|
required: false
|
85
85
|
|
86
|
-
# Set sane defaults
|
87
|
-
default = Hash.new
|
88
|
-
|
89
|
-
default['from'] = 'root@' + @fqdn,
|
90
|
-
default['to'] = 'lars.bahner@gmail.com',
|
91
|
-
default['smtp_host'] = 'localhost',
|
92
|
-
default['smtp_port'] = '25'
|
93
|
-
default['subject'] = 'Sensu@' + @event['client']['name'] + ': ' + status_text
|
94
|
-
|
95
86
|
def initialize
|
96
87
|
|
97
88
|
@fqdn = %x(hostname -f)
|
98
89
|
|
90
|
+
# Set sane defaults
|
91
|
+
@default = Hash.new
|
92
|
+
|
93
|
+
@default['from'] = "root@#{@fqdn}"
|
94
|
+
@default['to'] = 'lars.bahner@gmail.com'
|
95
|
+
@default['smtp_host'] = 'localhost'
|
96
|
+
@default['smtp_port'] = '25'
|
97
|
+
@default['subject'] = "Sensu@#{@event['client']['name']}:#{status_text}"
|
98
|
+
|
99
99
|
end
|
100
100
|
|
101
101
|
def status_text
|
@@ -119,7 +119,7 @@ class Mailhandler < Sensu::Handler
|
|
119
119
|
elsif @event['check'][name]
|
120
120
|
@event['check'][name]
|
121
121
|
else
|
122
|
-
default[name]
|
122
|
+
@default[name]
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|