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 +4 -4
- data/CHANGELOG.md +11 -3
- data/bin/check-dir-size.rb +1 -1
- data/bin/check-file-exists.rb +27 -7
- data/lib/sensu-plugins-filesystem-checks/version.rb +2 -2
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb8236a90866b3ee9289ba29b6795587f5510808
|
4
|
+
data.tar.gz: 23154779a73b3f92815daac2bace451c7855b2c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 334ee3223a06b8d09772c53ce30c56a5161b79f0cb5de10043ed411ef68644e5303e1cba8b3987adf341b507cce763822815040b50d31432838e8c78a9a043e2
|
7
|
+
data.tar.gz: bd6faaa854f8d007d7c7d2b2f5a35da93a1a7c477665544c3d3966c56e4fe7d69d128900f43d86a56180f21b0bade403cf3a6819f1288745ca0a776575159533
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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/
|
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
|
data/bin/check-dir-size.rb
CHANGED
@@ -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
|
-
# [--
|
27
|
+
# [--ignore-missing]
|
28
28
|
#
|
29
29
|
# EXAMPLE:
|
30
30
|
# check-dir-size.rb /var/spool/example_dir -w 1500000 -c 2000000
|
data/bin/check-file-exists.rb
CHANGED
@@ -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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
84
|
+
ok 'No matching files found'
|
65
85
|
end
|
66
86
|
end
|
67
87
|
end
|
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.
|
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:
|
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:
|
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:
|
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:
|
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.
|
215
|
+
rubygems_version: 2.4.5
|
216
216
|
signing_key:
|
217
217
|
specification_version: 4
|
218
218
|
summary: Sensu plugins for filesystems
|