sensu-plugins-statuspage 1.1.1 → 1.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: 80aabe282c7e1a3d0decb07122fe6f11395729f0
4
- data.tar.gz: f55dac75ac222c27fca00c9851eebfa6225d7fd7
3
+ metadata.gz: 5d1fe598ca1e022f60f0b744165bb78aca10dda2
4
+ data.tar.gz: f7c01757ed924ce79e47fa7ccaa1b57a3240c1cd
5
5
  SHA512:
6
- metadata.gz: e5939500cf3d61815821aecccc1f7f023485c463ce0be85f4056694c3d1643adfdbcac384102d1cfcc191cb9c41462db135886d6cdea7199c09521cb4a384cfb
7
- data.tar.gz: 1376593061013119d83d441c30104bfcd138cf9a7b6be98a71b6163f01d4f4d46aaa1ac23c1655fbf49aeee34f2a7684a157c6bfeb0e43c118548cd02547d15e
6
+ metadata.gz: fe45106f6f0e511c81542c93b3d4f8468d713c3a52f767859d91b391bea541ccf962ef6ccd61d1d02a9300e5ea801a77e723bb37df7bc6e21438091c2e796d36
7
+ data.tar.gz: 68180f42518cbb4657b5f18cec1494b8b11c3e209b63997a08f59c1566d9201ea69d6b804e2f14aef018e28e20f3f7c6670f19233eb07adb9353a45954b35dab
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.2.0] - 2017-07-21
9
+ ### Added
10
+ - check-statuspage-status.rb: a plugin to check the status rollup of a statuspage instance (@spacepants)
11
+
8
12
  ## [1.1.1] - 2017-07-21
9
13
  ### Fixed
10
14
  - metrics-statuspageio.rb: remove 'handlers' key from settings variable(@chrissav)
@@ -38,7 +42,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
38
42
  ### Added
39
43
  - initial release
40
44
 
41
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-statuspage/compare/1.1.1...HEAD
45
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-statuspage/compare/1.2.0...HEAD
46
+ [1.2.0]: https://github.com/sensu-plugins/sensu-plugins-statuspage/compare/1.1.1...1.2.0
42
47
  [1.1.1]: https://github.com/sensu-plugins/sensu-plugins-statuspage/compare/1.1.0...1.1.1
43
48
  [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-statuspage/compare/1.0.0...1.1.0
44
49
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-statuspage/compare/0.0.3...1.0.0
data/README.md CHANGED
@@ -16,7 +16,12 @@ Creates an issue on StatusPage.io and (optionally) updates a component status.
16
16
 
17
17
  Sends graphite-style metrics to statuspage.io, for displaying public metrics. Note, this forks and is not meant for high-throughput. Rather, it is meant for high-value, low-throughput metrics for display on status page.
18
18
 
19
+ **check-statuspage-status**
20
+
21
+ Check the status rollup of a statuspage instance
22
+
19
23
  ## Files
24
+ * bin/check-statuspage-status
20
25
  * bin/handler-statuspage
21
26
  * bin/metrics-statuspageio
22
27
 
@@ -57,6 +62,12 @@ For use of a basic proxy, use "proxy_address" and "proxy_port":
57
62
  }
58
63
  }
59
64
  ```
65
+
66
+ **check-statuspage-status**
67
+
68
+ Use `-u` to set the url to your statuspage instance.
69
+ * `/opt/sensu/embedded/bin/check-statuspage-status.rb -u https://metastatuspage.com`
70
+
60
71
  ## Installation
61
72
 
62
73
  [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
@@ -0,0 +1,61 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-statuspage-status
4
+ #
5
+ # DESCRIPTION:
6
+ # This is a simple check for the status rollup of a StatusPage instance.
7
+ #
8
+ # OUTPUT:
9
+ # plain text
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # USAGE:
15
+ # check-statuspage-status -u https://metastatuspage.com
16
+ #
17
+ # Depends on httparty gem
18
+ # gem install httparty
19
+ #
20
+ # LICENSE:
21
+ # Paul Bailey <https://github.com/spacepants>
22
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
23
+ # for details.
24
+
25
+ require 'sensu-plugin/check/cli'
26
+ require 'httparty'
27
+ require 'json'
28
+
29
+ class CheckStatusPageStatus < Sensu::Plugin::Check::CLI
30
+ option :url,
31
+ description: 'URL',
32
+ short: '-u URL',
33
+ long: '--url URL',
34
+ required: true
35
+
36
+ def get(url)
37
+ response = HTTParty.get(url, format: :plain)
38
+ JSON.parse response, symbolize_names: true
39
+ rescue HTTParty::Error
40
+ critical 'HTTParty error'
41
+ rescue JSON::ParserError
42
+ critical 'Invalid JSON'
43
+ rescue StandardError
44
+ critical 'Connection error'
45
+ end
46
+
47
+ def run
48
+ resource = get("#{config[:url]}/api/v2/status.json")
49
+ status = resource[:status]
50
+ case status[:indicator]
51
+ when 'critical'
52
+ critical status[:description]
53
+ when 'major', 'minor'
54
+ warning status[:description]
55
+ when 'none'
56
+ ok status[:description]
57
+ else
58
+ unknown status[:description]
59
+ end
60
+ end
61
+ end
@@ -3,8 +3,8 @@ module SensuPluginsStatuspage
3
3
  # This defines the version of the gem
4
4
  module Version
5
5
  MAJOR = 1
6
- MINOR = 1
7
- PATCH = 1
6
+ MINOR = 2
7
+ PATCH = 0
8
8
 
9
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-statuspage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
@@ -181,6 +181,7 @@ dependencies:
181
181
  description: Sensu statuspage plugins
182
182
  email: "<sensu-users@googlegroups.com>"
183
183
  executables:
184
+ - check-statuspage-status.rb
184
185
  - handler-statuspage.rb
185
186
  - metrics-statuspageio.rb
186
187
  extensions: []
@@ -189,6 +190,7 @@ files:
189
190
  - CHANGELOG.md
190
191
  - LICENSE
191
192
  - README.md
193
+ - bin/check-statuspage-status.rb
192
194
  - bin/handler-statuspage.rb
193
195
  - bin/metrics-statuspageio.rb
194
196
  - lib/sensu-plugins-statuspage.rb