sensu-plugins-twilio 0.0.3 → 0.0.4

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6e9b0ff74f2d3e031433bf11b730ae049a5ee344
4
- data.tar.gz: bbf354f111598f11bcedd53668634c9f0d2def90
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Y2VkOTYyODE1NjE3NGQ3YTU4ZWE3ZDFjMWE0NmUyZTNkNjMzMzI1OA==
5
+ data.tar.gz: !binary |-
6
+ YjUwOTVhN2UxYjc0YzFmYzJlOGI3ZjcxMzYwZDc4OGUxMTI4OTg4NQ==
5
7
  SHA512:
6
- metadata.gz: 05226be2c18c0014b7ff0d03a6d24a80488fe8f574a5107d79f7448d6fac9668d999473a375c9a3ed7619d0afcb72a71486b92266a8f34140571e675a4eea269
7
- data.tar.gz: 51d02e7a87b5c8e4f84f3c6400c0f64405acaf5cf139593fc8e99b1eac3f2afec4d3c2a2576da6083ca84552a1a073e9199d7fe385207acbbb7d02d5a7d09028
8
+ metadata.gz: !binary |-
9
+ ZTMwZGY4ODczYmRhMmRkY2JmOTZjYTE0OWM0ODg1NWVhMjEyZjVhZjk5NWEy
10
+ MTY5OGFlZWU5NjEwNmY1ODI0ZTEzZGM0ZjliYTNjNGE4NDBjZDhmNjc3ZmQy
11
+ MmI2MmFmZGM2NmFhYzUyMTc2YWMzMmU2ZWZhNDdmOTE0YzhhYmI=
12
+ data.tar.gz: !binary |-
13
+ YzczNDZlMzUzMjlmY2E4MTk0ZjkxYWI2NWY1MzA5M2E2N2QxZjgwMGQzYzYz
14
+ YTc4ZTdmM2FkODc3YjY2N2U5MDhmYWY0N2NkYjMzZTNlYWI3YTZkNGVmMWRi
15
+ Yjc2YmY4YTk0MTk4YzQzY2QwNWUzY2M0MmQ5MDQ3YzBiNzQ3Y2I=
data/CHANGELOG.md CHANGED
@@ -3,14 +3,17 @@ 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.0.4] - 2016-04-26
9
+ ### Fixed
10
+ - add functionality to disable resolve alerts
7
11
 
8
12
  ## [0.0.3] - 2015-07-14
9
13
  ### Changed
10
14
  - updated sensu-plugin gem to 1.2.0
11
15
 
12
16
  ## [0.0.2] - 2015-06-03
13
-
14
17
  ### Fixed
15
18
  - added binstubs
16
19
 
@@ -18,6 +21,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
18
21
  - removed cruft from /lib
19
22
 
20
23
  ## 0.0.1 - 2015-05-20
21
-
22
24
  ### Added
23
25
  - initial release
26
+
27
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-twilio/compare/0.0.4...HEAD
28
+ [0.0.4]: https://github.com/sensu-plugins/sensu-plugins-twilio/compare/0.0.3...0.0.4
29
+ [0.0.3]: https://github.com/sensu-plugins/sensu-plugins-twilio/compare/0.0.2...0.0.3
30
+ [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-twilio/compare/0.0.1...0.0.2
data/README.md CHANGED
@@ -5,7 +5,6 @@
5
5
  [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-twilio/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-twilio)
6
6
  [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-twilio/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-twilio)
7
7
  [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-twilio.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-twilio)
8
- [ ![Codeship Status for sensu-plugins/sensu-plugins-twilio](https://codeship.com/projects/879f33a0-dc04-0132-6ddb-025863fcc952/status?branch=master)](https://codeship.com/projects/79857)
9
8
 
10
9
  ## Functionality
11
10
 
@@ -38,6 +37,6 @@
38
37
  ```
39
38
  ## Installation
40
39
 
41
- [Installation and Setup](https://github.com/sensu-plugins/documentation/blob/master/user_docs/installation_instructions.md)
40
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
42
41
 
43
42
  ## Notes
@@ -93,7 +93,7 @@ class TwilioRecordings < Sensu::Plugin::Check::CLI
93
93
  unknown "Received #{response.code} response code from Twilio checking account #{name}" if response.code != '200'
94
94
 
95
95
  # Parse Twilio XML
96
- messages = Nori.new(advanced_typecasting: false, advanced_typecasting: false).parse(response.body)
96
+ messages = Nori.new(advanced_typecasting: false).parse(response.body)
97
97
  total = messages['TwilioResponse']['Recordings']['@total'].to_i
98
98
 
99
99
  if total >= config[:critical].to_i
@@ -29,26 +29,27 @@ class TwilioSMS < Sensu::Handler
29
29
  from_number = settings['twiliosms']['number']
30
30
  candidates = settings['twiliosms']['recipients']
31
31
  short = settings['twiliosms']['short'] || false
32
+ disable_ok = settings['twiliosms']['disableOk'] || false
32
33
 
33
- fail 'Please define a valid Twilio authentication set to use this handler' unless account_sid && auth_token && from_number
34
- fail 'Please define a valid set of SMS recipients to use this handler' if candidates.nil? || candidates.empty?
34
+ return if @event['action'].eql?('resolve') && disable_ok
35
+
36
+ raise 'Please define a valid Twilio authentication set to use this handler' unless account_sid && auth_token && from_number
37
+ raise 'Please define a valid set of SMS recipients to use this handler' if candidates.nil? || candidates.empty?
35
38
 
36
39
  recipients = []
37
- # #YELLOW
38
- candidates.each do |mobile, candidate| # rubocop:disable Style/Next
39
- if ((candidate['sensu_roles'].include?('all')) ||
40
- ((candidate['sensu_roles'] & @event['check']['subscribers']).size > 0) ||
41
- (candidate['sensu_checks'].include?(@event['check']['name']))) &&
42
- (candidate['sensu_level'] >= @event['check']['status'])
43
- recipients << mobile
44
- end
40
+ candidates.each do |mobile, candidate|
41
+ next unless (candidate['sensu_roles'].include?('all') ||
42
+ ((candidate['sensu_roles'] & @event['check']['subscribers']).size > 0) || # rubocop:disable Style/ZeroLengthPredicate
43
+ candidate['sensu_checks'].include?(@event['check']['name'])) &&
44
+ (candidate['sensu_level'] >= @event['check']['status'])
45
+ recipients << mobile
45
46
  end
46
47
 
47
- if short
48
- message = "Sensu #{action_to_string}: #{@event['check']['output']}"
49
- else
50
- message = "Sensu #{action_to_string}: #{short_name} (#{@event['client']['address']}) #{@event['check']['output']}"
51
- end
48
+ message = if short
49
+ "Sensu #{action_to_string}: #{@event['check']['output']}"
50
+ else
51
+ "Sensu #{action_to_string}: #{short_name} (#{@event['client']['address']}) #{@event['check']['output']}"
52
+ end
52
53
 
53
54
  message[157..message.length] = '...' if message.length > 160
54
55
 
@@ -2,7 +2,7 @@ module SensuPluginsTwilio
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 3
5
+ PATCH = 4
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,51 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-twilio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMRIwEAYDVQQDDAltYXR0
14
- am9uZXMxGDAWBgoJkiaJk/IsZAEZFgh5aWVsZGJvdDETMBEGCgmSJomT8ixkARkW
15
- A2NvbTAeFw0xNTAxMjgyMTAyNTFaFw0xNjAxMjgyMTAyNTFaMEMxEjAQBgNVBAMM
16
- CW1hdHRqb25lczEYMBYGCgmSJomT8ixkARkWCHlpZWxkYm90MRMwEQYKCZImiZPy
17
- LGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyTSzVYnO
18
- CLgyrIyT1mBQakArQyW8xhi6MlDqyzXHJGeERT790U6EgoBVeS4XoK0ptFZNR8Tf
19
- zko0w+Nv47TarSCgkPOaxY+mxWnAVR10dOmfeLr7huiMyps+YD56/EF2FqQ3jf/+
20
- qohENfKD91qy1ieEy+Fn7Pf74ltbNKUdkb9a9eFXQ0DQ4ip5vik7DzjQkUTj4lca
21
- k6ArwnmHX4YDhZoYtrQJ8jVktN0/+NtA40M5qkCYHNe5tUW25b/tKVYuioxG6b2Z
22
- oIzaZxRLxf6HVAWpCVRT/F5+/yjigkX4u++eYacfLGleXQzoK7BL65vHGMJygWEE
23
- 0TKGqFOrl/L0AQIDAQABo38wfTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNV
24
- HQ4EFgQUEf6a8Td7MrSZc8ImbLFZAENPbz0wIQYDVR0RBBowGIEWbWF0dGpvbmVz
25
- QHlpZWxkYm90LmNvbTAhBgNVHRIEGjAYgRZtYXR0am9uZXNAeWllbGRib3QuY29t
26
- MA0GCSqGSIb3DQEBBQUAA4IBAQBbzXAYA3BVGw8DZ0YYoY1VHPNEcH5qPIApmHO8
27
- rvSmuUT0yMEi7u00H/5uHRFf4LleGT/+sTdyXKsNPGT9kdRuQEgwi+vf7Zfvd8aX
28
- UF/+4VkEYf/8rV8Ere6u2QaWPgApdMV6JjKr1fAwCTd8AuGXNaWItiPPMseSQzLJ
29
- JKP4hVvbc1d+oS925B1lcBiqn2aYvElbyNAVmQPywNNqkWmvtlqj9ZVJfV5HQLdu
30
- 8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
- HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
- -----END CERTIFICATE-----
33
- date: 2015-07-14 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2016-04-27 00:00:00.000000000 Z
34
12
  dependencies:
35
13
  - !ruby/object:Gem::Dependency
36
14
  name: sensu-plugin
37
15
  requirement: !ruby/object:Gem::Requirement
38
16
  requirements:
39
- - - '='
17
+ - - ~>
40
18
  - !ruby/object:Gem::Version
41
- version: 1.2.0
19
+ version: '1.2'
42
20
  type: :runtime
43
21
  prerelease: false
44
22
  version_requirements: !ruby/object:Gem::Requirement
45
23
  requirements:
46
- - - '='
24
+ - - ~>
47
25
  - !ruby/object:Gem::Version
48
- version: 1.2.0
26
+ version: '1.2'
49
27
  - !ruby/object:Gem::Dependency
50
28
  name: twilio-ruby
51
29
  requirement: !ruby/object:Gem::Requirement
@@ -89,136 +67,136 @@ dependencies:
89
67
  - !ruby/object:Gem::Version
90
68
  version: 2.6.0
91
69
  - !ruby/object:Gem::Dependency
92
- name: codeclimate-test-reporter
70
+ name: bundler
93
71
  requirement: !ruby/object:Gem::Requirement
94
72
  requirements:
95
- - - "~>"
73
+ - - ~>
96
74
  - !ruby/object:Gem::Version
97
- version: '0.4'
75
+ version: '1.7'
98
76
  type: :development
99
77
  prerelease: false
100
78
  version_requirements: !ruby/object:Gem::Requirement
101
79
  requirements:
102
- - - "~>"
80
+ - - ~>
103
81
  - !ruby/object:Gem::Version
104
- version: '0.4'
82
+ version: '1.7'
105
83
  - !ruby/object:Gem::Dependency
106
- name: rubocop
84
+ name: codeclimate-test-reporter
107
85
  requirement: !ruby/object:Gem::Requirement
108
86
  requirements:
109
- - - '='
87
+ - - ~>
110
88
  - !ruby/object:Gem::Version
111
- version: '0.30'
89
+ version: '0.4'
112
90
  type: :development
113
91
  prerelease: false
114
92
  version_requirements: !ruby/object:Gem::Requirement
115
93
  requirements:
116
- - - '='
94
+ - - ~>
117
95
  - !ruby/object:Gem::Version
118
- version: '0.30'
96
+ version: '0.4'
119
97
  - !ruby/object:Gem::Dependency
120
- name: rspec
98
+ name: github-markup
121
99
  requirement: !ruby/object:Gem::Requirement
122
100
  requirements:
123
- - - "~>"
101
+ - - ~>
124
102
  - !ruby/object:Gem::Version
125
- version: '3.1'
103
+ version: '1.3'
126
104
  type: :development
127
105
  prerelease: false
128
106
  version_requirements: !ruby/object:Gem::Requirement
129
107
  requirements:
130
- - - "~>"
108
+ - - ~>
131
109
  - !ruby/object:Gem::Version
132
- version: '3.1'
110
+ version: '1.3'
133
111
  - !ruby/object:Gem::Dependency
134
- name: bundler
112
+ name: pry
135
113
  requirement: !ruby/object:Gem::Requirement
136
114
  requirements:
137
- - - "~>"
115
+ - - ~>
138
116
  - !ruby/object:Gem::Version
139
- version: '1.7'
117
+ version: '0.10'
140
118
  type: :development
141
119
  prerelease: false
142
120
  version_requirements: !ruby/object:Gem::Requirement
143
121
  requirements:
144
- - - "~>"
122
+ - - ~>
145
123
  - !ruby/object:Gem::Version
146
- version: '1.7'
124
+ version: '0.10'
147
125
  - !ruby/object:Gem::Dependency
148
126
  name: rake
149
127
  requirement: !ruby/object:Gem::Requirement
150
128
  requirements:
151
- - - "~>"
129
+ - - ~>
152
130
  - !ruby/object:Gem::Version
153
- version: '10.0'
131
+ version: '10.5'
154
132
  type: :development
155
133
  prerelease: false
156
134
  version_requirements: !ruby/object:Gem::Requirement
157
135
  requirements:
158
- - - "~>"
136
+ - - ~>
159
137
  - !ruby/object:Gem::Version
160
- version: '10.0'
138
+ version: '10.5'
161
139
  - !ruby/object:Gem::Dependency
162
- name: github-markup
140
+ name: redcarpet
163
141
  requirement: !ruby/object:Gem::Requirement
164
142
  requirements:
165
- - - "~>"
143
+ - - ~>
166
144
  - !ruby/object:Gem::Version
167
- version: '1.3'
145
+ version: '3.2'
168
146
  type: :development
169
147
  prerelease: false
170
148
  version_requirements: !ruby/object:Gem::Requirement
171
149
  requirements:
172
- - - "~>"
150
+ - - ~>
173
151
  - !ruby/object:Gem::Version
174
- version: '1.3'
152
+ version: '3.2'
175
153
  - !ruby/object:Gem::Dependency
176
- name: redcarpet
154
+ name: rubocop
177
155
  requirement: !ruby/object:Gem::Requirement
178
156
  requirements:
179
- - - "~>"
157
+ - - ~>
180
158
  - !ruby/object:Gem::Version
181
- version: '3.2'
159
+ version: '0.37'
182
160
  type: :development
183
161
  prerelease: false
184
162
  version_requirements: !ruby/object:Gem::Requirement
185
163
  requirements:
186
- - - "~>"
164
+ - - ~>
187
165
  - !ruby/object:Gem::Version
188
- version: '3.2'
166
+ version: '0.37'
189
167
  - !ruby/object:Gem::Dependency
190
- name: yard
168
+ name: rspec
191
169
  requirement: !ruby/object:Gem::Requirement
192
170
  requirements:
193
- - - "~>"
171
+ - - ~>
194
172
  - !ruby/object:Gem::Version
195
- version: '0.8'
173
+ version: '3.4'
196
174
  type: :development
197
175
  prerelease: false
198
176
  version_requirements: !ruby/object:Gem::Requirement
199
177
  requirements:
200
- - - "~>"
178
+ - - ~>
201
179
  - !ruby/object:Gem::Version
202
- version: '0.8'
180
+ version: '3.4'
203
181
  - !ruby/object:Gem::Dependency
204
- name: pry
182
+ name: yard
205
183
  requirement: !ruby/object:Gem::Requirement
206
184
  requirements:
207
- - - "~>"
185
+ - - ~>
208
186
  - !ruby/object:Gem::Version
209
- version: '0.10'
187
+ version: '0.8'
210
188
  type: :development
211
189
  prerelease: false
212
190
  version_requirements: !ruby/object:Gem::Requirement
213
191
  requirements:
214
- - - "~>"
192
+ - - ~>
215
193
  - !ruby/object:Gem::Version
216
- version: '0.10'
194
+ version: '0.8'
217
195
  description: Sensu plugins for twilio
218
- email: "<sensu-users@googlegroups.com>"
196
+ email: <sensu-users@googlegroups.com>
219
197
  executables:
220
- - handler-twiliosms.rb
221
198
  - check-num-recordings.rb
199
+ - handler-twiliosms.rb
222
200
  extensions: []
223
201
  extra_rdoc_files: []
224
202
  files:
@@ -245,17 +223,17 @@ require_paths:
245
223
  - lib
246
224
  required_ruby_version: !ruby/object:Gem::Requirement
247
225
  requirements:
248
- - - ">="
226
+ - - ! '>='
249
227
  - !ruby/object:Gem::Version
250
228
  version: 1.9.3
251
229
  required_rubygems_version: !ruby/object:Gem::Requirement
252
230
  requirements:
253
- - - ">="
231
+ - - ! '>='
254
232
  - !ruby/object:Gem::Version
255
233
  version: '0'
256
234
  requirements: []
257
235
  rubyforge_project:
258
- rubygems_version: 2.4.6
236
+ rubygems_version: 2.4.5
259
237
  signing_key:
260
238
  specification_version: 4
261
239
  summary: Sensu plugins for twilio
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
@@ -1,5 +0,0 @@
1
- u���,��EE��o���Un���m.�T������xnT��}0��$ؔ��wWF��R��-�:{��՘kl�bb�bq��Ӊ��j�j��
2
- �{^jUtͮ��MǢ����M�>F�"ƍzY��4V���Ni3�L;�b����S��
3
- V�n2ٛ ��E��Q7�9����M\�Bu��!]0�F�}��<����d��.��H�|��tW��
4
- �qq
5
- +��;:A��u�@�T���^��G���2P��S#?�P��WW��