sensu-plugins-disk-checks 2.0.1 → 2.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: 1017c60b1c58d6bce40c4aeae7d8ae5f5df1d202
4
- data.tar.gz: 7bb82598df6b65ae47fdf45aa0fe91099c1756aa
3
+ metadata.gz: 84f05a4a6178a02e5798248cd1c67eadcb6235e2
4
+ data.tar.gz: fa409bbe0762c858f885127cb29633e397a57ca4
5
5
  SHA512:
6
- metadata.gz: 9fd0746371815af81bcbb2b31540e81642d2d341b5f33459d6724f1e94bea3771e48d230f0a3040fcdf7a5d91d5698c2a5c5bbb1d2d7529c7dbb81a214e81171
7
- data.tar.gz: 7dab0601b071ad0ed8abe2edbefc4775e24b580096b2f8be4e0af14a1ce43a111752c6e2d272bc91808aeb52a1ea5e1fd8065b6534621b10407f33b9bb676792
6
+ metadata.gz: e66515d72f04a69716714af53fae709d47ad377f35f7fc2ebec35d8ce5d86f3602fc064f3a973e582374c1dc31323fcf04dbec6be7072c37cfe459c6702b90c0
7
+ data.tar.gz: 6170411f699673da8e69ca097cd3df92224fedd8b76e68ce4b56fdb2572994ae15ffcf64e87e4e1fe575cbf305c78ee21bbc71d909c26f596b9bb7ed51e70fa5
@@ -4,6 +4,15 @@ 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.1.0] - 2017-05-04
8
+ ### Changed
9
+ - check-disk-usage.rb: show the decimals for disk usage figures
10
+ - check-disk-usage.rb: dont do utilization check of devfs filesystems
11
+ - bump sys-filesystem to 1.1.7
12
+
13
+ ### Fixed
14
+ - check-fstab-mounts.rb: support swap mounts defined using UUID or LABEL
15
+ - check-fstab-mounts.rb: support swap mounts defined using LVM /dev/mapper/*
7
16
 
8
17
  ## [2.0.1] - 2016-06-15
9
18
  ### Fixed
@@ -110,7 +119,8 @@ https://mathias-kettner.de/checkmk_filesystems.html
110
119
  ### Added
111
120
  - initial release
112
121
 
113
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/2.0.1...HEAD
122
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/2.1.0...HEAD
123
+ [2.1.0]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/2.0.1...2.1.0
114
124
  [2.0.1]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/2.0.0...2.0.1
115
125
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/1.1.3...2.0.0
116
126
  [1.1.3]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/1.1.2...1.1.3
data/README.md CHANGED
@@ -40,7 +40,7 @@ Acquire disk capacity metrics from `df` and convert them to a form usable by gra
40
40
 
41
41
  Read */proc/iostats* for disk metrics and put them in a form usable by Graphite. See [iostats.txt](http://www.kernel.org/doc/Documentation/iostats.txt) for more details.
42
42
 
43
- **metrics-disk-uasage**
43
+ **metrics-disk-usage**
44
44
 
45
45
  Based on disk-capacity-metrics.rb by bhenerey and nstielau. The difference here being how the key is defined in graphite and the size we emit to graphite(now using megabytes), inode info has also been dropped.
46
46
 
@@ -97,4 +97,4 @@ This is a sample input file used by check-smart-status, see the script for furth
97
97
  ### Certification Verification
98
98
 
99
99
  If you are verifying certificates in the gem install you will need the certificate for the `sys-filesystem` gem loaded
100
- in the gem certificate store. That cert can be found [here](https://raw.githubusercontent.com/djberg96/sys-filesystem/ffi/certs/djberg96_pub.pem).
100
+ in the gem certificate store. That cert can be found [here](https://raw.githubusercontent.com/djberg96/sys-filesystem/ffi/certs/djberg96_pub.pem).
@@ -149,6 +149,9 @@ class CheckDisk < Sensu::Plugin::Check::CLI
149
149
  @warn_fs << "#{line.mount_point} Unable to read."
150
150
  return
151
151
  end
152
+ if line.mount_type == 'devfs'
153
+ return
154
+ end
152
155
  if fs_info.respond_to?(:inodes) && !fs_info.inodes.nil? # needed for windows
153
156
  percent_i = percent_inodes(fs_info)
154
157
  if percent_i >= config[:icrit]
@@ -179,7 +182,7 @@ class CheckDisk < Sensu::Plugin::Check::CLI
179
182
 
180
183
  def to_human(s)
181
184
  unit = [[1_099_511_627_776, 'TiB'], [1_073_741_824, 'GiB'], [1_048_576, 'MiB'], [1024, 'KiB'], [0, 'B']].detect { |u| s >= u[0] }
182
- "#{s >= 1024 ? s / unit[0] : s} #{unit[1]}"
185
+ format("%.2f #{unit[1]}", (s >= 1024 ? s.to_f / unit[0] : s))
183
186
  end
184
187
 
185
188
  # Determine the percent inode usage
@@ -51,6 +51,32 @@ class CheckFstabMounts < Sensu::Plugin::Check::CLI
51
51
  @missing_mounts = []
52
52
  end
53
53
 
54
+ def resolve_device(d)
55
+ if d.start_with?('UUID=')
56
+ uuid = d.split('=')[1]
57
+ path = File.join('/', 'dev', 'disk', 'by-uuid', uuid)
58
+ if File.exist?(path) && File.symlink?(path)
59
+ return File.realpath(path)
60
+ end
61
+ end
62
+
63
+ if d.start_with?('LABEL=')
64
+ label = d.split('=')[1]
65
+ path = File.join('/', 'dev', 'disk', 'by-label', label)
66
+ if File.exist?(path) && File.symlink?(path)
67
+ return File.realpath(path)
68
+ end
69
+ end
70
+
71
+ if d.start_with?('/dev/mapper')
72
+ if File.symlink?(d)
73
+ d = File.realpath(d, '/')
74
+ end
75
+ end
76
+
77
+ d
78
+ end
79
+
54
80
  # Check by mount destination (col 2 in fstab and proc/mounts)
55
81
  #
56
82
  def check_mounts
@@ -60,10 +86,11 @@ class CheckFstabMounts < Sensu::Plugin::Check::CLI
60
86
  fields = line.split(/\s+/)
61
87
  next if fields[1] == 'none' || (fields[3].include? 'noauto')
62
88
  next if config[:fstypes] && !config[:fstypes].include?(fields[2])
89
+
63
90
  if fields[2] != 'swap'
64
91
  @missing_mounts << fields[1] if @mtab.select { |m| m.split(/\s+/)[1] == fields[1] }.empty?
65
92
  else
66
- @missing_mounts << fields[1] if @swap_mounts.select { |m| m.split(/\s+/)[0] == Pathname.new(fields[0]).realpath.to_s }.empty? # rubocop:disable Style/IfInsideElse
93
+ @missing_mounts << fields[1] if @swap_mounts.select { |m| m.split(/\s+/)[0] == resolve_device(fields[0]) }.empty? # rubocop:disable Style/IfInsideElse
67
94
  end
68
95
  end
69
96
  end
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsDiskChecks
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-disk-checks
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
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-15 00:00:00.000000000 Z
11
+ date: 2017-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.5
33
+ version: 1.1.7
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.1.5
40
+ version: 1.1.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -218,9 +218,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  requirements: []
220
220
  rubyforge_project:
221
- rubygems_version: 2.5.1
221
+ rubygems_version: 2.4.5
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: Sensu plugins for disk checks
225
225
  test_files: []
226
- has_rdoc: