sensu-plugins-xmatters 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/handler-xmatters.rb +7 -1
- data/lib/xmatters-sensu.rb +8 -5
- data/lib/xmatters-sensu/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b873a5bb59a7091c27291ad04afd8432a7475dc
|
4
|
+
data.tar.gz: 0375a22f52806639bd50371ebd18eddc94e8f9d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
data/bin/handler-xmatters.rb
CHANGED
@@ -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
|
data/lib/xmatters-sensu.rb
CHANGED
@@ -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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
#
|
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
|
+
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:
|
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.
|
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.
|
139
|
+
version: '1.6'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: redcarpet
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|