vaimo-messages-handler 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f9798ff3c65a5efd39f2da97eb9f2ca7905b037
4
- data.tar.gz: c416429a4017c665200ce8e94834bc098409ac82
3
+ metadata.gz: 98cfb9be60295cd43df33e78edaeab9dce0975dd
4
+ data.tar.gz: fc9e3553dba97c1f56c2be75a33f88d6c1396dab
5
5
  SHA512:
6
- metadata.gz: 2293a7cdf133a1f33fc96dc14cffac1897be29b04cd3e9b788280cfcce0e7400ce95a9a350c489b2de4783279c56c94c7f6f23c8be06ffdd850d791fbe4db5f6
7
- data.tar.gz: bd4c3a97b2dc529108db46a052393f1b4116b037ada4e7245d35e91d631cea0ba9cca1ec284848efb6f80e9a973acfbecbb257499ddb54a0f4dcfa634b13632c
6
+ metadata.gz: 14905127a04f9875771a9231e112a8b3d6c769ef09a1aa938cacc573d6740dc236ec9fed44bd3c14b378b5b6f3b140c9eb2bbd5cef32c9ff3f3354e2882d19ec
7
+ data.tar.gz: f9a7bbe42fff773c8b14ebf09bf865f60c098a2ccf5eb694df6b099195f7f676d667abfa5a67e8be7caeb829660a969f3e5d1f27b4caf69e37b29ebc3ff74eca
data/bin/send-message.rb CHANGED
@@ -128,15 +128,16 @@ log = Logger.new('/tmp/sensu-messages-handler.log')
128
128
  log.level = Logger::INFO
129
129
 
130
130
  begin
131
- event = JSON.parse(STDIN.read)
131
+ raw_data = STDIN.read
132
+ event = JSON.parse(raw_data)
132
133
 
133
134
  sensu_settings
134
135
  messages_settings = sensu_setting('messages')
135
136
 
136
137
  args = {
137
- server: event[0]['client']['name'],
138
- component: event[0]['check']['name'],
139
- level: messages_level(event[0]['check']['status'])
138
+ server: event['client']['name'],
139
+ component: event['check']['name'],
140
+ level: messages_level(event['check']['status'])
140
141
  }
141
142
 
142
143
  post_args = messages_post_args(args, messages_settings)
@@ -144,9 +145,10 @@ begin
144
145
  messages_send(post_args, messages_settings)
145
146
  rescue => e
146
147
  open('/tmp/sensu-messages-handler.data', 'w') do |f|
147
- f.puts STDIN.read
148
+ f.puts raw_data
148
149
  end
149
150
 
150
151
  log.error "Messages Error: #{e}"
152
+ log.error "Messages Trace: #{e.backtrace}"
151
153
  end
152
154
 
@@ -2,7 +2,7 @@ module VaimoMessagesHandler
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- PATCH = 2
5
+ PATCH = 3
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vaimo-messages-handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Margus Heinmaa
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  requirements: []
185
185
  rubyforge_project:
186
- rubygems_version: 2.5.2.3
186
+ rubygems_version: 2.5.2.1
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: Sensu plugins for Messages handling