sensu-plugins-victorops 0.0.3 → 0.1.0

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: de4d7961bb32852fcd9a47b8a1bc72e5205e16d6
4
- data.tar.gz: 0ab48b94a60788081420dde17bbd5906446abb59
3
+ metadata.gz: 293634ca8c9095c8aeb6f017a843ff622fb3cf27
4
+ data.tar.gz: 3fff3b715c8b6f0cef7a8bef0cfd6b9e67fd9612
5
5
  SHA512:
6
- metadata.gz: 9ee4b132d1aa7e59e90d13342f9dbe11706a796686e57c00cabb3ac40100e2d46cde8a76733e8972c36dd6cb2eb55d85d488da96c7198ef57193e62891d5ad3f
7
- data.tar.gz: 2d84009892b3c284f8681e6c498ab4375c77c38240e60bdef349832343af8fba9f901f66ccba3f7ff57710b546c4cc1d239ae8ee50aee27ec89085fc4d21a429
6
+ metadata.gz: 692cab05165162704333001eacb877ab1716efc37f621cb0d51a5c7b6001e95f6f07a1a8dd621cd36e9a006b222991a6b8f04b0167426467d6374a38f4e77d77
7
+ data.tar.gz: 3c66d074fcc822d450fa0bb4762edfc8631d1d6298e9ee5912621f4e35fc1f3d7eba2a4084d9781cf57c6b96aff09f4ab1f5c01de9bc133e81b2f40d07d74ffe
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -3,7 +3,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
- ## Unreleased][unreleased]
6
+ ## Unreleased
7
+
8
+ ## [0.1.0] - 2015-11-06
9
+ ### Fixed
10
+ - create binstubs only for ruby files
11
+
12
+ ### Added
13
+ - Added settingsname and routing_key options
7
14
 
8
15
  ## [0.0.3] - 2015-07-14
9
16
  ### Changed
data/README.md CHANGED
@@ -24,7 +24,7 @@
24
24
  ```
25
25
  ## Installation
26
26
 
27
- [Installation and Setup](https://github.com/sensu-plugins/documentation/blob/master/user_docs/installation_instructions.md)
27
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
28
28
 
29
29
 
30
30
  ## Notes
@@ -3,6 +3,10 @@
3
3
  #
4
4
  # Released under the same terms as Sensu (the MIT license); see LICENSE
5
5
  # for details.
6
+ #
7
+ # arguments:
8
+ # - settingsname: Sensu settings name, defaults to victorops
9
+ # - routingkey: VictorOps routing key
6
10
 
7
11
  require 'sensu-handler'
8
12
  require 'uri'
@@ -10,12 +14,37 @@ require 'net/http'
10
14
  require 'net/https'
11
15
  require 'json'
12
16
 
13
- #
14
- # VictorOps Handler
15
- #
16
17
  class VictorOps < Sensu::Handler
18
+ option :settingsname,
19
+ description: 'Sensu settings name',
20
+ short: '-n NAME',
21
+ long: '--name NAME',
22
+ default: 'victorops'
23
+
24
+ option :routing_key,
25
+ description: 'Routing key',
26
+ short: '-r KEY',
27
+ long: '--routingkey KEY',
28
+ default: nil
29
+
17
30
  def handle
18
- config = settings['victorops']
31
+ # validate that we have settings
32
+ unless defined? settings[config[:settingsname]] && !settings[config[:settingsname]].nil?
33
+ fail "victorops.rb sensu setting '#{config[:settingsname]}' not found or empty"
34
+ end
35
+ unless defined? settings[config[:settingsname]]['api_url'] && !settings[config[:settingsname]]['api_url'].nil?
36
+ fail "victorops.rb sensu setting '#{config[:settingsname]}.api_url' not found or empty"
37
+ end
38
+ api_url = settings[config[:settingsname]]['api_url']
39
+
40
+ # validate that we have a routing key - command arguments take precedence
41
+ routing_key = config[:routing_key]
42
+ routing_key = settings[config[:settingsname]]['routing_key'] if routing_key.nil?
43
+
44
+ unless defined? routing_key && !routing_key.nil?
45
+ fail 'routing key not defined, should be in Sensu settings or passed via command arguments'
46
+ end
47
+
19
48
  incident_key = @event['client']['name'] + '/' + @event['check']['name']
20
49
 
21
50
  description = @event['check']['notification']
@@ -48,9 +77,7 @@ class VictorOps < Sensu::Handler
48
77
  payload[:check] = @event['check']
49
78
  payload[:client] = @event['client']
50
79
 
51
- routing_key = @event[:check][:routing_key] ? @event[:check][:routing_key] : config['routing_key']
52
-
53
- uri = URI("#{config['api_url'].chomp('/')}/#{routing_key}")
80
+ uri = URI("#{api_url.chomp('/')}/#{routing_key}")
54
81
  https = Net::HTTP.new(uri.host, uri.port)
55
82
 
56
83
  https.use_ssl = true
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsVictorops
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 0
5
- PATCH = 3
4
+ MINOR = 1
5
+ PATCH = 0
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: sensu-plugins-victorops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu Plugins and contributors
@@ -30,92 +30,92 @@ cert_chain:
30
30
  8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
31
  HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
32
  -----END CERTIFICATE-----
33
- date: 2015-07-14 00:00:00.000000000 Z
33
+ date: 2015-11-06 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
- name: sensu-plugin
36
+ name: json
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 1.2.0
41
+ version: 1.8.2
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - '='
47
47
  - !ruby/object:Gem::Version
48
- version: 1.2.0
48
+ version: 1.8.2
49
49
  - !ruby/object:Gem::Dependency
50
- name: json
50
+ name: sensu-plugin
51
51
  requirement: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - '='
54
54
  - !ruby/object:Gem::Version
55
- version: 1.8.2
55
+ version: 1.2.0
56
56
  type: :runtime
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - '='
61
61
  - !ruby/object:Gem::Version
62
- version: 1.8.2
62
+ version: 1.2.0
63
63
  - !ruby/object:Gem::Dependency
64
- name: codeclimate-test-reporter
64
+ name: bundler
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '0.4'
69
+ version: '1.7'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '0.4'
76
+ version: '1.7'
77
77
  - !ruby/object:Gem::Dependency
78
- name: rubocop
78
+ name: codeclimate-test-reporter
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '='
81
+ - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '0.30'
83
+ version: '0.4'
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '='
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0.30'
90
+ version: '0.4'
91
91
  - !ruby/object:Gem::Dependency
92
- name: rspec
92
+ name: github-markup
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '3.1'
97
+ version: '1.3'
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '3.1'
104
+ version: '1.3'
105
105
  - !ruby/object:Gem::Dependency
106
- name: bundler
106
+ name: pry
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '1.7'
111
+ version: '0.10'
112
112
  type: :development
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: '1.7'
118
+ version: '0.10'
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: rake
121
121
  requirement: !ruby/object:Gem::Requirement
@@ -131,61 +131,61 @@ dependencies:
131
131
  - !ruby/object:Gem::Version
132
132
  version: '10.0'
133
133
  - !ruby/object:Gem::Dependency
134
- name: github-markup
134
+ name: redcarpet
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: '1.3'
139
+ version: '3.2'
140
140
  type: :development
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: '1.3'
146
+ version: '3.2'
147
147
  - !ruby/object:Gem::Dependency
148
- name: redcarpet
148
+ name: rspec
149
149
  requirement: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: '3.2'
153
+ version: '3.1'
154
154
  type: :development
155
155
  prerelease: false
156
156
  version_requirements: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: '3.2'
160
+ version: '3.1'
161
161
  - !ruby/object:Gem::Dependency
162
- name: yard
162
+ name: rubocop
163
163
  requirement: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - "~>"
165
+ - - '='
166
166
  - !ruby/object:Gem::Version
167
- version: '0.8'
167
+ version: 0.32.1
168
168
  type: :development
169
169
  prerelease: false
170
170
  version_requirements: !ruby/object:Gem::Requirement
171
171
  requirements:
172
- - - "~>"
172
+ - - '='
173
173
  - !ruby/object:Gem::Version
174
- version: '0.8'
174
+ version: 0.32.1
175
175
  - !ruby/object:Gem::Dependency
176
- name: pry
176
+ name: yard
177
177
  requirement: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - "~>"
180
180
  - !ruby/object:Gem::Version
181
- version: '0.10'
181
+ version: '0.8'
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - "~>"
187
187
  - !ruby/object:Gem::Version
188
- version: '0.10'
188
+ version: '0.8'
189
189
  description: Sensu plugins for Victorops alerting service
190
190
  email: "<sensu-users@googlegroups.com>"
191
191
  executables:
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
225
  version: '0'
226
226
  requirements: []
227
227
  rubyforge_project:
228
- rubygems_version: 2.4.6
228
+ rubygems_version: 2.4.8
229
229
  signing_key:
230
230
  specification_version: 4
231
231
  summary: Sensu plugins for Victorops alerting service
metadata.gz.sig CHANGED
Binary file