sensu-plugins-pagerduty 2.1.0 → 2.2.0
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 +4 -4
- data/CHANGELOG.md +7 -2
- data/README.md +1 -1
- data/bin/handler-pagerduty.rb +12 -3
- data/lib/sensu-plugins-pagerduty/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5499485d200a12a466209edae02d4a6d1fd9b493
|
|
4
|
+
data.tar.gz: 1705a7a8347944e01fd4d58d45ffe58f6621ccb9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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
|
|
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
|
{
|
data/bin/handler-pagerduty.rb
CHANGED
|
@@ -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
|
-
|
|
113
|
-
|
|
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
|
-
|
|
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
|
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.
|
|
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-
|
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sensu-plugin
|