sensu-plugins-github 1.0.0 → 1.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: 4b9945073e5d20947fc066c43eaf72dc0a6fa583
4
- data.tar.gz: 814b97411b40fd7fd1f19b2431ee83c920ad1d05
3
+ metadata.gz: d65eb1a17bac50f33b0f2db60f0e940366ecd4d7
4
+ data.tar.gz: ebf4b5ffba0356e7670f1cd700bdf8f1517a77e2
5
5
  SHA512:
6
- metadata.gz: 3e8f8ab8ea9e795a7a46caed92827402846dbbbad51d6133287062ad8f3b4d746fc344b04706e743b67a8a43282ac111a21e9f5853cac63754d787957254fca1
7
- data.tar.gz: 16a7be73168efe7943f9fd1484e7271b1e9ce58630c1fd1589214b02669aa37225b6781f8a4777f6124b5876ed367017dff5cffd1d7cdf404539121183109484
6
+ metadata.gz: 1b76dea292fd685a82f6a5795b1ddbbef70645f8fe7da4c2dfae2c22577353cf5688cfe12c29574ba5416b8b0330fe03834b64db9278613d7206651b7d8516b9
7
+ data.tar.gz: dc3876ea3313cd91bd8ae5a47f6925f8f57184a4455f54cec387ecc9a23cb08cbbd33a64504e82632972df6b65b1cd5903f4c3ed3a35af6ccb8bd00901b1ac56
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## Unreleased[unreleased]
7
7
 
8
+ ## [1.1.0] - 2015-09-10
9
+ ### Added
10
+ - check-github-system-status for checking the status of github itself
11
+
8
12
  ## [1.0.0] - 2015-08-14
9
13
  ### Added
10
14
  - check-github-rate-limit.rb for checking the rate limit of a user
data/README.md CHANGED
@@ -15,6 +15,7 @@ Interacts with Github API to generate metrics about repo.
15
15
 
16
16
  ## Files
17
17
  * bin/check-github-rate-limit.rb
18
+ * bin/check-github-system-status.rb
18
19
  * bin/check-user-2fa.rb
19
20
  * bin/metrics-github-repo.rb
20
21
 
@@ -0,0 +1,54 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-github-system-status.rb
4
+ #
5
+ # DESCRIPTION:
6
+ # Interacts with Github Status API to check the system status of Github.com itself.
7
+ #
8
+ # OUTPUT:
9
+ #
10
+ # PLATFORMS:
11
+ # All
12
+ #
13
+ # DEPENDENCIES:
14
+ # gem: sensu-plugin
15
+ # gem: rest-client
16
+ # gem: json
17
+ #
18
+ # USAGE:
19
+ #
20
+ #
21
+ # NOTES:
22
+ #
23
+ #
24
+ # LICENSE:
25
+ # Copyright 2015 Yieldbot, devops@yieldbot.com
26
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
27
+ # for details.
28
+ #
29
+
30
+ require 'sensu-plugin/check/cli'
31
+ require 'rest-client'
32
+ require 'json'
33
+
34
+ class CheckSystemStatus < Sensu::Plugin::Check::CLI
35
+ def api_request(endpoint)
36
+ request = RestClient::Resource.new(endpoint)
37
+ JSON.parse(request.get)
38
+ rescue RestClient::ResourceNotFound
39
+ warning "Resource not found (or not accessible): #{resource}"
40
+ rescue Errno::ECONNREFUSED
41
+ warning 'Connection refused'
42
+ rescue RestClient::RequestFailed => e
43
+ warning "Request failed: #{e.inspect}"
44
+ rescue RestClient::RequestTimeout
45
+ warning 'Connection timed out'
46
+ rescue JSON::ParserError
47
+ warning 'Github API returned invalid JSON'
48
+ end
49
+
50
+ def run
51
+ status_url = 'https://status.github.com/api/status.json'
52
+ ok api_request(status_url)
53
+ end
54
+ end
@@ -3,7 +3,7 @@ require 'json'
3
3
  module SensuPluginsGithub
4
4
  module Version
5
5
  MAJOR = 1
6
- MINOR = 0
6
+ MINOR = 1
7
7
  PATCH = 0
8
8
 
9
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu Plugins and contributors
@@ -30,7 +30,7 @@ cert_chain:
30
30
  8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
31
  HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
32
  -----END CERTIFICATE-----
33
- date: 2015-08-15 00:00:00.000000000 Z
33
+ date: 2015-09-10 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rest-client
@@ -191,6 +191,7 @@ email: "<sensu-users@googlegroups.com>"
191
191
  executables:
192
192
  - github-repo-metrics.rb
193
193
  - check-user-2fa.rb
194
+ - check-github-system-status.rb
194
195
  - check-github-rate-limit.rb
195
196
  extensions: []
196
197
  extra_rdoc_files: []
@@ -199,6 +200,7 @@ files:
199
200
  - LICENSE
200
201
  - README.md
201
202
  - bin/check-github-rate-limit.rb
203
+ - bin/check-github-system-status.rb
202
204
  - bin/check-user-2fa.rb
203
205
  - bin/github-repo-metrics.rb
204
206
  - lib/sensu-plugins-github.rb
metadata.gz.sig CHANGED
Binary file