sensu-plugins-rabbitmq 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 +13 -1
- data/bin/check-rabbitmq-consumers.rb +15 -12
- data/bin/check-rabbitmq-queue.rb +22 -3
- data/lib/sensu-plugins-rabbitmq/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff32df838a2e797f64a61cbe8252c90dbc4c9a0b
|
4
|
+
data.tar.gz: 22809d71989e50eec3dd8adbe9250d1bab5d0599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fe85be96dc866d9c236252b3495272173b45818830fc7fd6086e9e7a5ddef51571dcfedd71fe2e92ee439d91a145eed6dedfb73ac281fecd95f59243ed1b3bc
|
7
|
+
data.tar.gz: 2ccf9af3dd6ef5095ad8221d15639085c8e7cd59e3c8e6059f8c465dcfffc3f068c31cdd4cde9f711f7b8d10ee22a00294edb9c8e055ba9bb84aace88608197d
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,17 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
|
+
### [2.2.0] - 2017-05-08
|
8
|
+
### Added
|
9
|
+
- check-rabbitmq-queue.rb: Added --below feature to specify if value below threshold should generate alert (@alexpekurovsky)
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
- check-rabbitmq-queue.rb: Fixes for assigning values to critical or warning states (@alexpekurovsky)
|
13
|
+
- check-rabbitmq-consumers.rb: Fixes rabbitmq empty value for consumers in some situations (@mdzidic)
|
14
|
+
- check-rabbitmq-consumers.rb: Fixes rabbitmq plugin crash when node is in network partition (@mdzidic)
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
- bump stomp version to 1.4.3
|
7
18
|
|
8
19
|
## [2.1.0] - 2017-01-10
|
9
20
|
### Added
|
@@ -107,7 +118,8 @@ NOTE: this release changes the option flags in check-rabbitmq-node-health.rb to
|
|
107
118
|
- Remove copy paste errors in the Readme
|
108
119
|
- Removed Rubygems require Ruby 1.8.7 backwards compatibility from all plugins
|
109
120
|
|
110
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-rabbitmq/compare/2.
|
121
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-rabbitmq/compare/2.2.0...HEAD
|
122
|
+
[2.2.0]: https://github.com/sensu-plugins/sensu-plugins-rabbitmq/compare/2.1.0...2.2.0
|
111
123
|
[2.1.0]: https://github.com/sensu-plugins/sensu-plugins-rabbitmq/compare/2.0.0...2.1.0
|
112
124
|
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-rabbitmq/compare/1.3.0...2.0.0
|
113
125
|
[1.3.0]: https://github.com/sensu-plugins/sensu-plugins-rabbitmq/compare/1.2.0...1.3.0
|
@@ -112,20 +112,23 @@ class CheckRabbitMQConsumers < Sensu::Plugin::Check::CLI
|
|
112
112
|
critical = []
|
113
113
|
warn = []
|
114
114
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
115
|
+
begin
|
116
|
+
rabbit.queues.each do |queue|
|
117
|
+
# if specific queues were passed only monitor those.
|
118
|
+
# if specific queues to exclude were passed then skip those
|
119
|
+
if config[:queue]
|
120
|
+
next unless config[:queue].include?(queue['name'])
|
121
|
+
elsif config[:exclude]
|
122
|
+
next if config[:exclude].include?(queue['name'])
|
123
|
+
end
|
124
|
+
missing.delete(queue['name'])
|
125
|
+
consumers = queue['consumers'] || 0
|
126
|
+
critical.push(queue['name']) if consumers <= config[:critical]
|
127
|
+
warn.push(queue['name']) if consumers <= config[:warn]
|
122
128
|
end
|
123
|
-
|
124
|
-
|
125
|
-
critical.push(queue['name']) if consumers <= config[:critical]
|
126
|
-
warn.push(queue['name']) if consumers <= config[:warn]
|
129
|
+
rescue
|
130
|
+
critical 'Could not find any queue, check rabbitmq server'
|
127
131
|
end
|
128
|
-
|
129
132
|
return_condition(missing, critical, warn)
|
130
133
|
end
|
131
134
|
end
|
data/bin/check-rabbitmq-queue.rb
CHANGED
@@ -96,6 +96,12 @@ class CheckRabbitMQMessages < Sensu::Plugin::Check::CLI
|
|
96
96
|
boolean: true,
|
97
97
|
default: false
|
98
98
|
|
99
|
+
option :below,
|
100
|
+
description: 'If set, values under threshold are counted as warning/critical',
|
101
|
+
long: '--below',
|
102
|
+
boolean: true,
|
103
|
+
default: false
|
104
|
+
|
99
105
|
def acquire_rabbitmq_info
|
100
106
|
begin
|
101
107
|
rabbitmq_info = CarrotTop.new(
|
@@ -115,7 +121,7 @@ class CheckRabbitMQMessages < Sensu::Plugin::Check::CLI
|
|
115
121
|
@crit = []
|
116
122
|
@warn = []
|
117
123
|
rabbitmq = acquire_rabbitmq_info
|
118
|
-
queues = rabbitmq.method_missing('
|
124
|
+
queues = rabbitmq.method_missing('queues/' + config[:vhost])
|
119
125
|
config[:queue].each do |q|
|
120
126
|
unless (queues.map { |hash| hash['name'] }.include?(q) && config[:regex] == false) || config[:regex] == true
|
121
127
|
unless config[:ignore]
|
@@ -128,10 +134,23 @@ class CheckRabbitMQMessages < Sensu::Plugin::Check::CLI
|
|
128
134
|
total = queue['messages']
|
129
135
|
total = 0 if total.nil?
|
130
136
|
message total.to_s
|
131
|
-
|
132
|
-
@warn << "#{queue['name']}:#{total}" if total > config[:warn].to_i && total < config[:critical].to_i
|
137
|
+
assign_alerts(queue['name'], total)
|
133
138
|
end
|
134
139
|
end
|
140
|
+
generate_output
|
141
|
+
end
|
142
|
+
|
143
|
+
def assign_alerts(queue_name, total)
|
144
|
+
if config[:below]
|
145
|
+
@crit << "#{queue_name}:#{total}" if total <= config[:critical].to_i
|
146
|
+
@warn << "#{queue_name}:#{total}" if total <= config[:warn].to_i && total > config[:critical].to_i
|
147
|
+
else
|
148
|
+
@crit << "#{queue_name}:#{total}" if total >= config[:critical].to_i
|
149
|
+
@warn << "#{queue_name}:#{total}" if total >= config[:warn].to_i && total < config[:critical].to_i
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def generate_output
|
135
154
|
if @crit.empty? && @warn.empty?
|
136
155
|
ok
|
137
156
|
elsif !@crit.empty?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-rabbitmq
|
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-
|
11
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.3
|
47
|
+
version: 1.4.3
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.3
|
54
|
+
version: 1.4.3
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rest-client
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|