sensu-plugins-ceph 0.0.4 → 0.0.5
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
- checksums.yaml.gz.sig +1 -2
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +8 -0
- data/bin/check-ceph.rb +9 -2
- data/bin/metrics-ceph-osd.rb +2 -2
- data/bin/metrics-ceph.rb +117 -0
- data/lib/sensu-plugins-ceph/version.rb +1 -1
- metadata +5 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93a68877548d810e932c6d3b36e3746543d8e4f0
|
4
|
+
data.tar.gz: dca6658840c0ce6a28b41f648fe41b66f9625b18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6443f403216c08bf5615bae0052fa075445602fb58bf38c4ba1fe4e1bc6543b2dee9018f35dd2f4536b877dbbfa3eaf065af79f2c990500dd29b5b7665c31878
|
7
|
+
data.tar.gz: 0b1b600d1f443758359e3b4b596951832fca9cbae83bcd3e3f8bd6b4b23e89bdbe97d127f2c71c48892d871a9046533ffe031d42db02226cddfebc18b2c0769c
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
��vi��b���hM�[+�C��`�z����P�m���Z���[[��2qbR��A����x�!��rU#K���qzZ �mke�M�6U�za~�sn�ޘYV��P�<v�SR�����eo�o|��>�ar'r�c
|
1
|
+
Q��O��B���oHcD��v>D�=+�-pYY��ǗH���ҫq�O����m����9尞œ���~��X���)|2gIH�{�v
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,14 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
6
6
|
## Unreleased
|
7
7
|
- nothing
|
8
8
|
|
9
|
+
## [0.0.5] - 2015-11-26
|
10
|
+
### Added
|
11
|
+
- include client name option when interacting with ceph
|
12
|
+
- metrics script
|
13
|
+
### Fixes
|
14
|
+
- use upstram output
|
15
|
+
- default prefix includes hostname
|
16
|
+
|
9
17
|
## [0.0.4] - 2015-07-31
|
10
18
|
### Changed
|
11
19
|
- updated documentation links
|
data/bin/check-ceph.rb
CHANGED
@@ -64,6 +64,12 @@ class CheckCephHealth < Sensu::Plugin::Check::CLI
|
|
64
64
|
long: '--cluster',
|
65
65
|
proc: proc { |c| " --cluster=#{c}" }
|
66
66
|
|
67
|
+
option :name,
|
68
|
+
description: 'Optional client name',
|
69
|
+
short: '-n NAME',
|
70
|
+
long: '--name',
|
71
|
+
proc: proc { |n| " --name=#{n}" }
|
72
|
+
|
67
73
|
option :timeout,
|
68
74
|
description: 'Timeout (default 10)',
|
69
75
|
short: '-t SEC',
|
@@ -91,12 +97,13 @@ class CheckCephHealth < Sensu::Plugin::Check::CLI
|
|
91
97
|
boolean: true,
|
92
98
|
default: false
|
93
99
|
|
94
|
-
def run_cmd(cmd)
|
100
|
+
def run_cmd(cmd)
|
95
101
|
pipe, status = nil
|
96
102
|
begin
|
97
103
|
cmd += config[:cluster] if config[:cluster]
|
98
104
|
cmd += config[:keyring] if config[:keyring]
|
99
105
|
cmd += config[:monitor] if config[:monitor]
|
106
|
+
cmd += config[:name] if config[:name]
|
100
107
|
cmd += ' 2>&1'
|
101
108
|
Timeout.timeout(config[:timeout]) do
|
102
109
|
pipe = IO.popen(cmd)
|
@@ -136,7 +143,7 @@ class CheckCephHealth < Sensu::Plugin::Check::CLI
|
|
136
143
|
end
|
137
144
|
end
|
138
145
|
|
139
|
-
def run
|
146
|
+
def run
|
140
147
|
result = check_ceph_health
|
141
148
|
ok result if result.start_with?('HEALTH_OK')
|
142
149
|
|
data/bin/metrics-ceph-osd.rb
CHANGED
@@ -68,9 +68,9 @@ class CephOsdMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
def run
|
71
|
+
def run
|
72
72
|
# #YELLOW
|
73
|
-
Dir.glob(config[:pattern]).each do |socket|
|
73
|
+
Dir.glob(config[:pattern]).each do |socket|
|
74
74
|
data = `ceph --admin-daemon #{socket} perf dump`
|
75
75
|
if $CHILD_STATUS.exitstatus == 0
|
76
76
|
# Left side of wildcard
|
data/bin/metrics-ceph.rb
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# metrics-ceph
|
4
|
+
#
|
5
|
+
# DESCRIPTION:
|
6
|
+
# Overall ceph throughput
|
7
|
+
#
|
8
|
+
# OUTPUT:
|
9
|
+
# metric data
|
10
|
+
#
|
11
|
+
# PLATFORMS:
|
12
|
+
# Linux
|
13
|
+
#
|
14
|
+
# DEPENDENCIES:
|
15
|
+
# gem: sensu-plugin
|
16
|
+
# gem: english
|
17
|
+
# ceph client
|
18
|
+
#
|
19
|
+
# USAGE:
|
20
|
+
# #YELLOW
|
21
|
+
#
|
22
|
+
# NOTES:
|
23
|
+
# Runs 'ceph status' command to output cluster status and metrics,
|
24
|
+
# May need read access to ceph keyring and/or root access for
|
25
|
+
# authentication.
|
26
|
+
#
|
27
|
+
# LICENSE:
|
28
|
+
# Released under the same terms as Sensu (the MIT license); see LICENSE
|
29
|
+
# for details.
|
30
|
+
#
|
31
|
+
|
32
|
+
require 'sensu-plugin/metric/cli'
|
33
|
+
require 'json'
|
34
|
+
require 'timeout'
|
35
|
+
require 'English'
|
36
|
+
require 'socket'
|
37
|
+
|
38
|
+
class CephMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
39
|
+
option :keyring,
|
40
|
+
description: 'Path to cephx authentication keyring file',
|
41
|
+
short: '-k KEY',
|
42
|
+
long: '--keyring',
|
43
|
+
proc: proc { |k| " -k #{k}" }
|
44
|
+
|
45
|
+
option :monitor,
|
46
|
+
description: 'Optional monitor IP',
|
47
|
+
short: '-m MON',
|
48
|
+
long: '--monitor',
|
49
|
+
proc: proc { |m| " -m #{m}" }
|
50
|
+
|
51
|
+
option :cluster,
|
52
|
+
description: 'Optional cluster name',
|
53
|
+
short: '-c NAME',
|
54
|
+
long: '--cluster',
|
55
|
+
proc: proc { |c| " --cluster=#{c}" }
|
56
|
+
|
57
|
+
option :name,
|
58
|
+
description: 'Optional client name',
|
59
|
+
short: '-n NAME',
|
60
|
+
long: '--name',
|
61
|
+
proc: proc { |n| " --name=#{n}" }
|
62
|
+
|
63
|
+
option :timeout,
|
64
|
+
description: 'Timeout (default 10)',
|
65
|
+
short: '-t SEC',
|
66
|
+
long: '--timeout',
|
67
|
+
proc: proc(&:to_i),
|
68
|
+
default: 10
|
69
|
+
|
70
|
+
option :prefix,
|
71
|
+
description: 'Metric prefix',
|
72
|
+
short: '-p PREFIX',
|
73
|
+
long: '--prefix',
|
74
|
+
default: "#{Socket.gethostname}.ceph"
|
75
|
+
|
76
|
+
def run_cmd(cmd)
|
77
|
+
pipe, status = nil
|
78
|
+
begin
|
79
|
+
cmd += config[:cluster] if config[:cluster]
|
80
|
+
cmd += config[:keyring] if config[:keyring]
|
81
|
+
cmd += config[:monitor] if config[:monitor]
|
82
|
+
cmd += config[:name] if config[:name]
|
83
|
+
cmd += ' 2>&1'
|
84
|
+
Timeout.timeout(config[:timeout]) do
|
85
|
+
pipe = IO.popen(cmd)
|
86
|
+
Process.wait(pipe.pid)
|
87
|
+
status = $CHILD_STATUS.exitstatus
|
88
|
+
end
|
89
|
+
rescue Timeout::Error
|
90
|
+
begin
|
91
|
+
Process.kill(9, pipe.pid)
|
92
|
+
Process.wait(pipe.pid)
|
93
|
+
rescue Errno::ESRCH, Errno::EPERM
|
94
|
+
# Catch errors from trying to kill the timed-out process
|
95
|
+
# We must do something here to stop travis complaining
|
96
|
+
critical 'Execution timed out'
|
97
|
+
ensure
|
98
|
+
critical 'Execution timed out'
|
99
|
+
end
|
100
|
+
end
|
101
|
+
output = pipe.read
|
102
|
+
critical "Command '#{cmd}' returned no output" if output.to_s == ''
|
103
|
+
critical output unless status == 0
|
104
|
+
output
|
105
|
+
end
|
106
|
+
|
107
|
+
def run
|
108
|
+
result = run_cmd('ceph status --format=json')
|
109
|
+
data = JSON.parse(result)
|
110
|
+
ignore_keys = %w(pgs_by_state version)
|
111
|
+
timestamp = Time.now.to_i
|
112
|
+
data['pgmap'].each do |key, val|
|
113
|
+
output "#{config[:prefix]}.#{key}", val, timestamp unless ignore_keys.include? key
|
114
|
+
end
|
115
|
+
ok
|
116
|
+
end
|
117
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-ceph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
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-26 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: english
|
@@ -189,6 +189,7 @@ dependencies:
|
|
189
189
|
description: Sensu plugins for ceph
|
190
190
|
email: "<sensu-users@googlegroups.com>"
|
191
191
|
executables:
|
192
|
+
- metrics-ceph.rb
|
192
193
|
- metrics-ceph-osd.rb
|
193
194
|
- check-ceph.rb
|
194
195
|
extensions: []
|
@@ -199,6 +200,7 @@ files:
|
|
199
200
|
- README.md
|
200
201
|
- bin/check-ceph.rb
|
201
202
|
- bin/metrics-ceph-osd.rb
|
203
|
+
- bin/metrics-ceph.rb
|
202
204
|
- lib/sensu-plugins-ceph.rb
|
203
205
|
- lib/sensu-plugins-ceph/version.rb
|
204
206
|
homepage: https://github.com/sensu-plugins/sensu-plugins-ceph
|
@@ -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 ceph
|
metadata.gz.sig
CHANGED
Binary file
|