sensu-plugins-xmatters 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: badb87db7fe359954ae2c26cf30512876bcb7b1a
4
- data.tar.gz: 39fcd32e76ca645d231dfbba91c8e1d8e8009edc
3
+ metadata.gz: 3b873a5bb59a7091c27291ad04afd8432a7475dc
4
+ data.tar.gz: 0375a22f52806639bd50371ebd18eddc94e8f9d8
5
5
  SHA512:
6
- metadata.gz: de6e564757688bf229bcb869956beb7a0f9b24018f09342fcc0f042239240964529f3a9ba992947dadce6ab626e4e3d60e238225a6dfae1d2b15af17bebef6ed
7
- data.tar.gz: 5de15d28d6285b9c125ce011c7d2046bf6da69e46e2db1a8592a043788650b550b0abd21939f93220b8fb119a3a7664ffba4a0346b42122f2afe41d5a0b7de11
6
+ metadata.gz: 88054616cecb302b164fe6035e3f27977b6d83b0352d41aa0bbcc415e51a12270cfdb6866d20b1b04d200fc3a299807a3298ac8b5d03a08901b78b14850a4ca1
7
+ data.tar.gz: 5d7fba703a610059c031d73d258e98721d5ceabf58c0d05290031792e989a86ee76049372f57231efbbaceca3fc05043828fd44437b2cfcd4fa9a81e0278551c
data/README.md CHANGED
@@ -74,7 +74,7 @@ The gem is available as open source under the terms of the [MIT License](http://
74
74
  During development, to execute tests and perform additional linting and validation run the following command:
75
75
 
76
76
  ```sh
77
- rake
77
+ bundle exec rake
78
78
  ```
79
79
 
80
80
  When ready to release a new version, run the following commands:
@@ -76,7 +76,13 @@ class XMattersHandler < Sensu::Handler
76
76
  begin
77
77
  case @event['action']
78
78
  when 'create'
79
- xm_client.send_event(payload)
79
+ response = xm_client.send_event(payload)
80
+ if response.is_a? Net::HTTPSuccess
81
+ puts 'Sent request to xMatters successfully.'
82
+ else
83
+ puts 'Failed to send request to xMatters.'
84
+ puts response.inspect
85
+ end
80
86
  when 'resolve'
81
87
  puts 'xMatters Handler bypassing resolve'
82
88
  end
@@ -30,11 +30,14 @@ module XMSensu
30
30
  # Sends the properties to the configured integration url in the correct json format
31
31
  #
32
32
  def send_event(properties)
33
- http = Net::HTTP.new(@uri.hostname, @uri.port)
34
- request = Net::HTTP::Post.new(@uri.path, @header)
35
- request.body = { properties: properties }.to_json
36
- http.use_ssl = true
37
- http.request(request)
33
+ response = nil
34
+ options = { use_ssl: true }
35
+ Net::HTTP.start(@uri.host, @uri.port, options) do |http|
36
+ request = Net::HTTP::Post.new(@uri, @header)
37
+ request.body = { properties: properties }.to_json
38
+ response = http.request request # Net::HTTPResponse object
39
+ end
40
+ response
38
41
  end
39
42
 
40
43
  #
@@ -17,7 +17,7 @@ module XMSensu
17
17
  #
18
18
  # PATCH Version
19
19
  #
20
- PATCH = 4
20
+ PATCH = 5
21
21
 
22
22
  #
23
23
  # Formatted Version String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-xmatters
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
  - xMatters
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-12 00:00:00.000000000 Z
12
+ date: 2018-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sensu-plugin
@@ -129,14 +129,14 @@ dependencies:
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: '1.3'
132
+ version: '1.6'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: '1.3'
139
+ version: '1.6'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: redcarpet
142
142
  requirement: !ruby/object:Gem::Requirement