sensu-plugins-sidekiq 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +5 -1
- data/README.md +23 -4
- data/bin/check-sidekiq-dead-queue.rb +55 -0
- data/lib/sensu-plugins-sidekiq/version.rb +2 -2
- metadata +7 -5
- metadata.gz.sig +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30dca3ebf775d05fde0202f4ed3d11fc9a907c38
|
4
|
+
data.tar.gz: f11e2cd1956a7051089e24a381b8727ec7a16a2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d9e3d0a93730510c06f4cbfad00db747481503d580c4f05357a17a1abc3645099934e09e6168b6391a9dd11194157c00025c48dc13b09d664d753f58ab526c9
|
7
|
+
data.tar.gz: 0674eb081e2946d48fe1a691b05d7127b2d5e3b7ee6f0c1fccc3f81d399483985200f2e4002e2aa157b63966b3e45c6996db7d85b69de5095641881e1f4ecb58
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,11 @@ 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
|
6
|
+
## Unreleased
|
7
|
+
|
8
|
+
## [0.1.0] - 2015-11-06
|
9
|
+
### Added
|
10
|
+
- new script `check-sidekiq-dead-queue.rb`
|
7
11
|
|
8
12
|
## [0.0.2] - 2015-07-14
|
9
13
|
### Changed
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Sensu-Plugins-sidekiq
|
2
2
|
|
3
|
-
[
|
3
|
+
[![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-sidekiq.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-sidekiq)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/sensu-plugins-sidekiq.svg)](http://badge.fury.io/rb/sensu-plugins-sidekiq)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-sidekiq/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-sidekiq)
|
6
6
|
[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-sidekiq/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-sidekiq)
|
@@ -9,10 +9,21 @@
|
|
9
9
|
|
10
10
|
## Functionality
|
11
11
|
|
12
|
-
Check varius metrics and checks for Sidekiq.
|
12
|
+
Check varius metrics and checks for Sidekiq.
|
13
|
+
The following scripts:
|
14
|
+
|
15
|
+
* bin/check-sidekiq.rb
|
16
|
+
* bin/sidekiq-metrics.rb
|
17
|
+
|
18
|
+
require [sidekiq-monitor-stats](https://github.com/harvesthq/sidekiq-monitor-stats)
|
13
19
|
running on your application. Pass the `--url URL` option with the url to your monitor stats. Both scripts also accept a
|
14
20
|
`--auth USER:PASSWORD` option in case the monitor stats url sits behind basic authorization.
|
15
21
|
|
22
|
+
* bin/check-sidekiq-dead-queue.rb
|
23
|
+
uses the native sidekiq JSON dashboard under `<mount point>/dashboard/stats`
|
24
|
+
[More info](https://github.com/mperham/sidekiq/wiki/Monitoring#using-the-built-in-dashboard)
|
25
|
+
|
26
|
+
|
16
27
|
### check-sidekiq.rb
|
17
28
|
|
18
29
|
Uses the maximum latency to figure out when to raise warnings. The latency is the time a job has been waiting in the queue (without
|
@@ -29,14 +40,22 @@ busy vs. concurrency is specially useful for capacity planning. The latency metr
|
|
29
40
|
are spikes that don't trigger a warning or a critical). Accepts an `--scheme SCHEME` option to know what scheme to append to the
|
30
41
|
metrics (the default is `sidekiq`).
|
31
42
|
|
43
|
+
|
44
|
+
### check-sidekiq-dead-queue.rb
|
45
|
+
Checks the dead queue and raises a CRITICAL if it's not empty. Jobs in the dead queue have failed over 25 times. Some organisations might consider this an issue to address and could benefit from this check.
|
46
|
+
|
47
|
+
|
32
48
|
## Files
|
33
49
|
* bin/check-sidekiq.rb
|
34
|
-
* bin/sidekiq-
|
50
|
+
* bin/sidekiq-metrics.rb
|
51
|
+
* bin/check-sidekiq-dead-queue.rb
|
35
52
|
|
36
53
|
## Usage
|
37
54
|
|
38
55
|
## Installation
|
39
56
|
|
40
|
-
[Installation and Setup](
|
57
|
+
[Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
|
41
58
|
|
42
59
|
## Notes
|
60
|
+
|
61
|
+
Thanks to [xxxxxx]() for contributing.
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
|
4
|
+
require 'sensu-plugin/check/cli'
|
5
|
+
require 'open-uri'
|
6
|
+
require 'json'
|
7
|
+
|
8
|
+
# DESCRIPTION:
|
9
|
+
# Check that the sidekiq dead queue size is 0 using the sidekiq
|
10
|
+
# stats JSON page under
|
11
|
+
# /sidekiq/dashboard/stats
|
12
|
+
#
|
13
|
+
# DEPENDENCIES:
|
14
|
+
# gem: sensu-plugin
|
15
|
+
# gem: open-uri
|
16
|
+
# gem: json
|
17
|
+
#
|
18
|
+
# LICENSE:
|
19
|
+
# by https://github.com/bennythejudge
|
20
|
+
# Released under the same terms as Sensu (the MIT license); see LICENSE
|
21
|
+
# for details.
|
22
|
+
class SidekiqCheck < Sensu::Plugin::Check::CLI
|
23
|
+
option :url,
|
24
|
+
short: '-u URL',
|
25
|
+
long: '--url URL',
|
26
|
+
description: 'Url to query',
|
27
|
+
required: true
|
28
|
+
|
29
|
+
option :auth,
|
30
|
+
short: '-a USER:PASSWORD',
|
31
|
+
long: '--auth USER:PASSWORD',
|
32
|
+
description: 'Basic auth credentials if you need them',
|
33
|
+
proc: proc { |auth| auth.split(':') }
|
34
|
+
|
35
|
+
def run
|
36
|
+
begin
|
37
|
+
stats = JSON.parse(
|
38
|
+
if config[:auth]
|
39
|
+
open(config[:url], http_basic_authentication: config[:auth]).read
|
40
|
+
else
|
41
|
+
open(config[:url]).read
|
42
|
+
end
|
43
|
+
)
|
44
|
+
rescue => error
|
45
|
+
unknown "Could not load Sidekiq stats from #{config[:url]}. Error: #{error}"
|
46
|
+
end
|
47
|
+
dead_queue_size = stats['sidekiq']['dead']
|
48
|
+
if !dead_queue_size.zero?
|
49
|
+
entry_or_entries = dead_queue_size > 1 ? 'entries' : 'entry'
|
50
|
+
critical 'dead queue not empty (' + dead_queue_size.to_s + ' ' + entry_or_entries + ')'
|
51
|
+
else
|
52
|
+
ok 'sidekiq dead queue is empty'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.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-
|
33
|
+
date: 2015-11-06 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: json
|
@@ -80,14 +80,14 @@ dependencies:
|
|
80
80
|
requirements:
|
81
81
|
- - '='
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 0.32.1
|
84
84
|
type: :development
|
85
85
|
prerelease: false
|
86
86
|
version_requirements: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - '='
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
90
|
+
version: 0.32.1
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rspec
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,12 +191,14 @@ email: "<sensu-users@googlegroups.com>"
|
|
191
191
|
executables:
|
192
192
|
- metrics-sidekiq.rb
|
193
193
|
- check-sidekiq.rb
|
194
|
+
- check-sidekiq-dead-queue.rb
|
194
195
|
extensions: []
|
195
196
|
extra_rdoc_files: []
|
196
197
|
files:
|
197
198
|
- CHANGELOG.md
|
198
199
|
- LICENSE
|
199
200
|
- README.md
|
201
|
+
- bin/check-sidekiq-dead-queue.rb
|
200
202
|
- bin/check-sidekiq.rb
|
201
203
|
- bin/metrics-sidekiq.rb
|
202
204
|
- lib/sensu-plugins-sidekiq.rb
|
@@ -227,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
229
|
version: '0'
|
228
230
|
requirements: []
|
229
231
|
rubyforge_project:
|
230
|
-
rubygems_version: 2.4.
|
232
|
+
rubygems_version: 2.4.8
|
231
233
|
signing_key:
|
232
234
|
specification_version: 4
|
233
235
|
summary: Sensu plugins for sidekiq
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
�� ֘�T������ۛ���H�@B�f ܦ�����8����N����I~����i���\u�%3N/���*�8�STg����Y���[+�/�EM��7�K"s�M�i�
|
2
|
+
شl)��H�@
|
3
|
+
��3G.^Aj�x�^����G[
|