sensu-plugins-pagerduty 2.1.0 → 2.2.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: 8013c82be04050d5d1a5be48b6ac670a77b1c0e7
4
- data.tar.gz: 9b3a495d37dd59456b85de2ca0f5d414ad5ec1c3
3
+ metadata.gz: 5499485d200a12a466209edae02d4a6d1fd9b493
4
+ data.tar.gz: 1705a7a8347944e01fd4d58d45ffe58f6621ccb9
5
5
  SHA512:
6
- metadata.gz: 3d852b6dfdac69026817475ab7e3adf5a6f6cf6155b17cdfecc23fc75ee7f9f8d1cce68c5fe86f5669f9883191deb091fbf5153ed6f79280f1cd5801774a0209
7
- data.tar.gz: d4d3f55744b81324f7b411de262f7cec5fa828a11d70ae4bbc3d3c86ef794775064cb663f3fc44a3fd93c1ee37c4abd1dcffa1c823bdaa5e7bac41d98718a2db
6
+ metadata.gz: a63f324f6c6442c56fa59710e114469997baa897c1cef64cdb2cf759b4631703faa2b4fa40bfc0f3ca759af7427403004ee3a5d5d8a2da7985512448baeca1af
7
+ data.tar.gz: bf252d9c1456ba084213c967a05cde05d8032d49480d4d22e34203fb89c49573705db7db12537083cea9a149a972af8a2c13cf25174abf6f3c2961c57d945838
data/CHANGELOG.md CHANGED
@@ -1,10 +1,14 @@
1
- #Change Log
1
+ # Change Log
2
2
  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
6
  ## [Unreleased]
7
7
 
8
+ ## [2.2.0] - 2017-03-23
9
+ ### Added
10
+ - Add retries for Timeouts and HTTP errors (@johanek)
11
+
8
12
  ## [2.1.0] - 2017-02-28
9
13
  ### Added
10
14
  - Add contexts support (@zroger)
@@ -94,7 +98,8 @@ marking it as a stable 1.0.0 release.
94
98
  ### Added
95
99
  - initial release
96
100
 
97
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-pagerduty/compare/2.1.0...HEAD
101
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-pagerduty/compare/2.2.0...HEAD
102
+ [2.2.0]: https://github.com/sensu-plugins/sensu-plugins-pagerduty/compare/2.1.0...2.2.0
98
103
  [2.1.0]: https://github.com/sensu-plugins/sensu-plugins-pagerduty/compare/2.0.0...2.1.0
99
104
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-pagerduty/compare/1.0.0...2.0.0
100
105
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-pagerduty/compare/0.0.9...1.0.0
data/README.md CHANGED
@@ -33,7 +33,7 @@ PagerDuty supports dedup. Dedup is useful when you want to create a single alert
33
33
  }
34
34
  ```
35
35
 
36
- In the Client hash you can define a `pager_team` key value pair. If the the client hash contains the `pager_team` key it will then no longer use the default `pagerduty.api_key` from the above has but will look for the value given in the client. The following client hash will alert using the team_name1 api key instead of the default api_key. This will allow different teams/hosts to alert different escalation paths.
36
+ In the Client hash you can define a `pager_team` key value pair. If the the client hash contains the `pager_team` key it will then no longer use the default `pagerduty.api_key` from the above hash but will look for the value given in the client. The following client hash will alert using the team_name1 api key instead of the default api_key. This will allow different teams/hosts to alert different escalation paths.
37
37
 
38
38
  ```
39
39
  {
@@ -84,6 +84,7 @@ class PagerdutyHandler < Sensu::Handler
84
84
  description_prefix = description_prefix()
85
85
  proxy_settings = proxy_settings()
86
86
  begin
87
+ tries ||= 3
87
88
  Timeout.timeout(10) do
88
89
  if proxy_settings['proxy_host']
89
90
  pagerduty = pd_client || Pagerduty.new(api_key,
@@ -109,12 +110,20 @@ class PagerdutyHandler < Sensu::Handler
109
110
  end
110
111
  puts 'pagerduty -- ' + @event['action'].capitalize + 'd incident -- ' + incident_key
111
112
  rescue Net::HTTPServerException => error
112
- puts 'pagerduty -- failed to ' + @event['action'] + ' incident -- ' + incident_key + ' -- ' +
113
- error.response.code + ' ' + error.response.message + ': ' + error.response.body
113
+ if (tries -= 1) > 0
114
+ retry
115
+ else
116
+ puts 'pagerduty -- failed to ' + @event['action'] + ' incident -- ' + incident_key + ' -- ' +
117
+ error.response.code + ' ' + error.response.message + ': ' + error.response.body
118
+ end
114
119
  end
115
120
  end
116
121
  rescue Timeout::Error
117
- puts 'pagerduty -- timed out while attempting to ' + @event['action'] + ' a incident -- ' + incident_key
122
+ if (tries -= 1) > 0
123
+ retry
124
+ else
125
+ puts 'pagerduty -- timed out while attempting to ' + @event['action'] + ' a incident -- ' + incident_key
126
+ end
118
127
  end
119
128
  end
120
129
  end
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsPagerduty
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 1
4
+ MINOR = 2
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-pagerduty
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-01 00:00:00.000000000 Z
11
+ date: 2017-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin