sensu-plugins-zfs 2.0.1 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9155212f4f7a372237dd47ab50a10d7a4a4c6b0a932fe1b4fdced82596e17d76
4
- data.tar.gz: d1c5210bee822f7e3e62797d031c92ef40c46ba19187811bcb0f335480776813
3
+ metadata.gz: f6af4620e6524523598b637b145394c2efa06fe68815905413552538ab4f0f7c
4
+ data.tar.gz: cd2ec56edaaf2de6ef0905f45990ddea40b578f5a4d234b05ce1bda2e10f3c3c
5
5
  SHA512:
6
- metadata.gz: bb7dce7d542fd88bc31ff6d100716d3fec51f72805baea144b682c2960ae42cc9d746d121319011911eab3185c2c924c7a6bc12d23c0eefc6e18664bc6b8721b
7
- data.tar.gz: 43d396458f264a768fbeb8de0471b0f098b31b28a91d09b5d8b9932d9e2ee5556558ab7c0758b0747c7df7ea15646bba8efdaf6e15f79fb5f0718421a5438845
6
+ metadata.gz: 8e4c10b744f790b659b4a8b00ca9c8279de85f48fa7da4e4d3bc01934340ad9ec66274c91edda93dae5da451cf478050019416b8ab94b4b3be71875713e7b626
7
+ data.tar.gz: c92027390e6d438dfa27ed0ac0ad3c6d2485599d464ecb245b5c5615290fd0463fccb5c8fb819140366c4dbd79fad8f265e3b2c02b78e2ef69e25fc839ef3ee0
data/README.md CHANGED
@@ -25,6 +25,14 @@ The following flags can be used to configure the checks.
25
25
  - `-C, --capacity-crit` Capacity threshold for when to crit. (default 90)
26
26
  - `-s, --scrubbing-interval` Warn when it is more than this number of days since last scrub. (default 7)
27
27
 
28
+ ## Metrics
29
+
30
+ ### metric-zfs-arc.rb
31
+
32
+ Reads `/proc/spl/kstat/zfs/arcstats` for ARC statistics and puts them in a form usable by Graphite.
33
+
34
+ For more information see ZoL [Linux Module Parameters](https://github.com/zfsonlinux/zfs/wiki/ZFS-on-Linux-Module-Parameters)
35
+
28
36
  ## Installation
29
37
  [Installation and setup](http://sensu-plugins.io/docs/installation_instructions.html)
30
38
 
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # ZFS ARC metrics
4
+ #
5
+ # DESCRIPTION:
6
+ # This collects ZFS ARC (Adaptive Replacement Cache) metrics
7
+ # metric-zfs-arc.rb looks at /proc/spl/kstat/zfs/arcstats
8
+ #
9
+ # OUTPUT:
10
+ # metric data
11
+ #
12
+ # PLATFORMS:
13
+ # Linux
14
+ #
15
+ # DEPENDENCIES:
16
+ # gem: sensu-plugin
17
+ # gem: socket
18
+ #
19
+ # USAGE:
20
+ # ./metric-zfs-arc.rb
21
+ #
22
+ # NOTES:
23
+ #
24
+ # LICENSE:
25
+ # Copyright 2019 Airbrake Technologies, Inc <support@airbrake.io>
26
+ # Released under the same terms as the Sensu (the MIT license); see LICENSE
27
+ # for details.
28
+
29
+ require 'sensu-plugin/metric/cli'
30
+ require 'socket'
31
+
32
+ #
33
+ # ZFS Arc Metrics
34
+ ##
35
+ class ZfsArcMetrics < Sensu::Plugin::Metric::CLI::Graphite
36
+ option :scheme,
37
+ description: 'Metric naming scheme, text to prepend to .$parent.#child',
38
+ short: '-s SCHEME',
39
+ long: '--scheme SCHEME',
40
+ default: "#{Socket.gethostname}.zfs"
41
+
42
+ def run
43
+ # ZFS ARC statistics
44
+ #
45
+ # Here is sample output on a test system from the first 5 lines
46
+ #
47
+ # /proc/spl/kstat/zfs/arcstats
48
+ #
49
+ # 13 1 0x01 96 26112 830229407922 1845600063633972
50
+ # name type data
51
+ # hits 4 3013872557
52
+ # misses 4 46742397
53
+ # demand_data_hits 4 2128530805
54
+
55
+ if File.exist?('/proc/spl/kstat/zfs/arcstats')
56
+ File.read('/proc/spl/kstat/zfs/arcstats').split("\n").drop(2).each do |row|
57
+ unless row.nil?
58
+ name, _type, data = row.split
59
+ output "#{config[:scheme]}.#{name}", data
60
+ end
61
+ end
62
+ ok
63
+ else
64
+ critical "File: '/proc/spl/kstat/zfs/arcstats' does not exist "
65
+ end
66
+ end
67
+ end
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsZFS
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 0
5
- PATCH = 1
4
+ MINOR = 1
5
+ PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-zfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Nørgaard
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-28 00:00:00.000000000 Z
12
+ date: 2019-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sensu-plugin
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '1.3'
48
+ version: '3.0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '1.3'
55
+ version: '3.0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: pry
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -143,12 +143,14 @@ email:
143
143
  - "<sensu-users@googlegroups.com>"
144
144
  executables:
145
145
  - check-zpool.rb
146
+ - metric-zfs-arc.rb
146
147
  extensions: []
147
148
  extra_rdoc_files: []
148
149
  files:
149
150
  - LICENSE
150
151
  - README.md
151
152
  - bin/check-zpool.rb
153
+ - bin/metric-zfs-arc.rb
152
154
  - lib/sensu-plugins-zfs.rb
153
155
  - lib/sensu-plugins-zfs/version.rb
154
156
  - lib/sensu-plugins-zfs/zpool.rb
@@ -177,8 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
179
  - !ruby/object:Gem::Version
178
180
  version: '0'
179
181
  requirements: []
180
- rubyforge_project:
181
- rubygems_version: 2.7.6
182
+ rubygems_version: 3.0.3
182
183
  signing_key:
183
184
  specification_version: 4
184
185
  summary: Sensu plugin for zfs