sensu-plugins-filesystem-checks 0.2.0 → 1.0.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: dbe2493bb95355d680d06d2c870a25520fb971b2
4
- data.tar.gz: a3ea4c03d9b9798c82a6024f940597c8a32faa99
3
+ metadata.gz: fb8236a90866b3ee9289ba29b6795587f5510808
4
+ data.tar.gz: 23154779a73b3f92815daac2bace451c7855b2c7
5
5
  SHA512:
6
- metadata.gz: 45ca11455597066d22a8e821f764b53bf2ede5090643d510c832be0349ec7cc1d4fc705b086f492f4626accd1aae8fd16e735d01170118f3d9c36a1be78fdf7e
7
- data.tar.gz: 77a6d40800b1c00e26d479b5064a82e149a2f5625550c1c6b1c40392bf5702230a7537c843fd909b97bd7aeb2f406a5ef864582d45c1614bdf027a6bed3c602d
6
+ metadata.gz: 334ee3223a06b8d09772c53ce30c56a5161b79f0cb5de10043ed411ef68644e5303e1cba8b3987adf341b507cce763822815040b50d31432838e8c78a9a043e2
7
+ data.tar.gz: bd6faaa854f8d007d7c7d2b2f5a35da93a1a7c477665544c3d3966c56e4fe7d69d128900f43d86a56180f21b0bade403cf3a6819f1288745ca0a776575159533
@@ -4,8 +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
+
8
+ ## [1.0.0] - 2017-07-01
7
9
  ### Added
8
- - Added 'metrics-nfsstat.rb' for collecting nfsstat metrics
10
+ - Added testing on Ruby 2.3.0 (@Evesy)
11
+ - Added support for globbing in 'check-file-exists.rb' (@Evesy)
12
+ - Added 'metrics-nfsstat.rb' for collecting nfsstat metrics (@maoe)
13
+
14
+ ### Breaking Changes
15
+ - Dropped Ruby 1.9 support
9
16
 
10
17
  ### Changed
11
18
  - Renamed metric-{dirsize,filename} to metrics-{dirsize,filename}
@@ -39,8 +46,9 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
39
46
  ### Added
40
47
  - initial release
41
48
 
42
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/compare/0.1.0...HEAD
49
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/compare/1.0.0...HEAD
50
+ [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/compare/0.0.4...1.0.0
43
51
  [0.1.0]: https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/compare/0.0.3...0.0.4
44
52
  [0.0.4]: https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/compare/0.0.3...0.0.4
45
53
  [0.0.3]: https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/compare/0.0.2...0.0.3
46
- [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/compare/0.0.1...0.0.2
54
+ [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/compare/0.0.1...0.0.2
@@ -24,7 +24,7 @@
24
24
  # [-w|--warn] <size, in bytes, to warn on>
25
25
  # [-c|--critical] <size, in bytes, to go CRITICAL on>
26
26
  # [-p|--du-path] <path/to/du>
27
- # [--ignore_missing]
27
+ # [--ignore-missing]
28
28
  #
29
29
  # EXAMPLE:
30
30
  # check-dir-size.rb /var/spool/example_dir -w 1500000 -c 2000000
@@ -1,4 +1,5 @@
1
1
  #! /usr/bin/env ruby
2
+ # encoding: UTF-8
2
3
  #
3
4
  # check-file-exists
4
5
  #
@@ -18,6 +19,9 @@
18
19
  # And then set it ok again with:
19
20
  # rm /tmp/CRITICAL
20
21
  #
22
+ # Supports globbing for basic wildcard matching
23
+ # Wildcard charaters must be quoted or escaped to prevent shell expansion
24
+ #
21
25
  # OUTPUT:
22
26
  # plain text
23
27
  #
@@ -54,14 +58,30 @@ class CheckFileExists < Sensu::Plugin::Check::CLI
54
58
  default: '/tmp/UNKNOWN'
55
59
 
56
60
  def run
57
- if config[:critical] && File.exist?(config[:critical])
58
- critical "#{config[:critical]} exists!"
59
- elsif config[:warning] && File.exist?(config[:warning])
60
- warning "#{config[:warning]} exists!"
61
- elsif config[:unknown] && File.exist?(config[:unknown])
62
- unknown "#{config[:unknown]} exists!"
61
+ critical_values = []
62
+ warning_values = []
63
+ unknown_values = []
64
+
65
+ Dir.glob(config[:critical]).each do |file|
66
+ critical_values << file
67
+ end
68
+
69
+ Dir.glob(config[:warning]).each do |file|
70
+ warning_values << file
71
+ end
72
+
73
+ Dir.glob(config[:unknown]).each do |file|
74
+ unknown_values << file
75
+ end
76
+
77
+ if critical_values.any?
78
+ critical "#{critical_values.count} matching file(s) found: #{critical_values.join(', ')}"
79
+ elsif warning_values.any?
80
+ warning "#{warning_values.count} matching file(s) found: #{warning_values.join(', ')}"
81
+ elsif unknown_values.any?
82
+ unknown "#{unknown_values.count} matching file(s) found: #{unknown_values.join(', ')}"
63
83
  else
64
- ok 'No test files exist'
84
+ ok 'No matching files found'
65
85
  end
66
86
  end
67
87
  end
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsFilesystemChecks
2
2
  module Version
3
- MAJOR = 0
4
- MINOR = 2
3
+ MAJOR = 1
4
+ MINOR = 0
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-filesystem-checks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.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-03-01 00:00:00.000000000 Z
11
+ date: 2017-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0.37'
131
+ version: 0.40.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0.37'
138
+ version: 0.40.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: yard
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -156,17 +156,17 @@ description: |-
156
156
  attributes.
157
157
  email: "<sensu-users@googlegroups.com>"
158
158
  executables:
159
- - metrics-nfsstat.rb
160
- - metrics-filesize.rb
161
- - metrics-dirsize.rb
162
- - check-tail.rb
163
- - check-mtime.rb
164
- - check-fs-writable.rb
165
- - check-file-size.rb
166
- - check-file-exists.rb
167
- - check-dir-size.rb
168
- - check-dir-count.rb
169
159
  - check-checksums.rb
160
+ - check-dir-count.rb
161
+ - check-dir-size.rb
162
+ - check-file-exists.rb
163
+ - check-file-size.rb
164
+ - check-fs-writable.rb
165
+ - check-mtime.rb
166
+ - check-tail.rb
167
+ - metrics-dirsize.rb
168
+ - metrics-filesize.rb
169
+ - metrics-nfsstat.rb
170
170
  extensions: []
171
171
  extra_rdoc_files: []
172
172
  files:
@@ -204,7 +204,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - ">="
206
206
  - !ruby/object:Gem::Version
207
- version: 1.9.3
207
+ version: 2.0.0
208
208
  required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  requirements:
210
210
  - - ">="
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  requirements: []
214
214
  rubyforge_project:
215
- rubygems_version: 2.4.8
215
+ rubygems_version: 2.4.5
216
216
  signing_key:
217
217
  specification_version: 4
218
218
  summary: Sensu plugins for filesystems