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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 850a82c9767464d7c05ea5dbf4b3bf3985867af9
4
- data.tar.gz: c8366be9915146b479004c88f11de8105e021c1b
3
+ metadata.gz: 2057c685440ab00bdedd71eb7e8f7d1afe91061f
4
+ data.tar.gz: 27d931d6e58dca9e6e42583be94d4ddf704cdf4d
5
5
  SHA512:
6
- metadata.gz: 1ecb5b68a3a41852f1ed68d70abef803d495de0cc828541ced6e2e3baca3d1688891a5bd76bed9b3116c3a3f574bba6d8d31fffd39b296b13d2f7ef81abba649
7
- data.tar.gz: 85607ea1e60df5e56e1c1d63069217dacf2e5e139657db789910175563270cc2fb05df679858d538c49546c699dfe302b0cc5586cb4d13c4dc67702370752fbd
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
 
@@ -2,7 +2,7 @@ module SensuPluginsMailhandler
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'sensu-plugins-mailhandler'
3
- s.version = '0.0.4'
3
+ s.version = '0.0.5'
4
4
  s.date = '2016-07-20'
5
5
  s.summary = 'Handler to easily send email'
6
6
  s.description = 'Handler to pretty print an event and send it as email.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-mailhandler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Bahner