sensu-plugins-disk-checks 5.1.1 → 5.1.2

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
  SHA256:
3
- metadata.gz: 7f12e621f9184db90da2f0ef2638cdbb09466fb488686619a2062fb7b5336315
4
- data.tar.gz: 81b1bb59a51305409c9203855ccc12b43ad50060543115ad4cf1913ad141aba1
3
+ metadata.gz: 817158f657fbdf221e2b5ec917a94c7dc1e4a8a864b0b97d41549825872e64a6
4
+ data.tar.gz: 21e2e575d5c986948ca08d3c3b6d11b8ff745b0e78d09df2f05b240ae2ee6807
5
5
  SHA512:
6
- metadata.gz: f435d5746fe00083205b6de15c62bda4516968204cd0a16ae45d6db7850fc352a6d6e45f038846459ea132b1594de0ece60b95c1096820ca18fda7ec14a6828d
7
- data.tar.gz: 6e19ad018f9d6a994ff89c293fa881c4c8b5c3469cab5aadcd6bd7bf090b0397beaa1bb7d3703d9f6b8f72a07c9aaf51cd91b209a9a6af99d549836d2d99e8aa
6
+ metadata.gz: e7eaede6d71ce75aa2622c9a6d0a215ca7c2bb195e903079f7d580fa17a1d6a73b12dffd768f28523a1edd9a98f2fd1bffc7d1a5ad36e6e8c2cdc0981a44b938
7
+ data.tar.gz: 4e467a8f4e7ab8ab06a105943a8609776abc1fa73c8c851fb872775e8f76bf77fa72bb337c04c6bc191cf1fc5ae9783fe715a6d4f417269cf6447de097376c2e
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [5.1.2] - 2020-05-20
9
+ ### Fixed
10
+ - check-disk-usage.rb: More accurate disk percent usage ignoring privileged bytes (@SaviourSelf)
11
+
8
12
  ## [5.1.1] - 2020-04-22
9
13
  ### Changed
10
14
  - Removed centos from .bonsai.yml to make Bonsai happy again
@@ -224,7 +228,8 @@ https://mathias-kettner.de/checkmk_filesystems.html
224
228
  ### Added
225
229
  - initial release
226
230
 
227
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/5.1.1...HEAD
231
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/5.1.2...HEAD
232
+ [5.1.2]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/5.1.1...5.1.2
228
233
  [5.1.1]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/5.1.0...5.1.1
229
234
  [5.1.0]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/5.0.1...5.1.0
230
235
  [5.0.1]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/5.0.0...5.0.1
@@ -66,7 +66,7 @@ class CheckDisk < Sensu::Plugin::Check::CLI
66
66
  proc: proc { |a| a.split('.') }
67
67
 
68
68
  option :ignore_reserved,
69
- description: 'Ignore bytes reserved for prvileged processes',
69
+ description: 'Ignore bytes reserved for privileged processes',
70
70
  short: '-r',
71
71
  long: '--ignore-reserved',
72
72
  boolean: true,
@@ -210,7 +210,13 @@ class CheckDisk < Sensu::Plugin::Check::CLI
210
210
  #
211
211
  def percent_bytes(fs_info)
212
212
  if config[:ignore_reserved]
213
- (100.0 - (100.0 * fs_info.bytes_available / fs_info.bytes_total)).round(2)
213
+ u100 = fs_info.bytes_used * 100.0
214
+ nonroot_total = fs_info.bytes_used + fs_info.bytes_available
215
+ if nonroot_total.zero?
216
+ 0
217
+ else
218
+ (u100 / nonroot_total + (u100 % nonroot_total != 0 ? 1 : 0)).round(2)
219
+ end
214
220
  else
215
221
  (100.0 - (100.0 * fs_info.bytes_free / fs_info.bytes_total)).round(2)
216
222
  end
@@ -4,7 +4,7 @@ module SensuPluginsDiskChecks
4
4
  module Version
5
5
  MAJOR = 5
6
6
  MINOR = 1
7
- PATCH = 1
7
+ PATCH = 2
8
8
 
9
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
10
10
  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: 5.1.1
4
+ version: 5.1.2
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: 2020-04-22 00:00:00.000000000 Z
11
+ date: 2020-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin