sensu-plugins-disk-checks 1.0.3 → 1.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +12 -2
- data/README.md +4 -19
- data/bin/check-disk-usage.rb +12 -1
- data/bin/metrics-disk.rb +17 -0
- data/lib/sensu-plugins-disk-checks/version.rb +2 -2
- metadata +2 -16
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf541ed738c5dda0c98dee881ee6de9d206a1b97
|
4
|
+
data.tar.gz: 5f527a4c79146b1fd4ee1d8db4aca2259f630b62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ece7fc89f0ec93ae225e9c5229dd9c920a8abcf6d54eed318cfddcd56b7ba18fd3bfc3bcdd2b8da9d48fa994e257e6067933f5acc748a615ec18b836425b578
|
7
|
+
data.tar.gz: cdc6bd79598623f77623598a907910df9eeff9a95b696bf43367350014d4c6057f5993861e51c2e3a2e7c2663e363cb2fef2df4448eb9a7e86552526d656351b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -3,8 +3,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
3
3
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
|
-
##
|
7
|
-
|
6
|
+
## Unreleased
|
7
|
+
|
8
|
+
## [1.1.0] - 2015-12-08
|
9
|
+
### Added
|
10
|
+
- check-disk-usage.rb: Add ignore option to exclude mount point(s) based on regular expression
|
11
|
+
- metrics-disk.rb: Add ignore and include options to exclude or include devices
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
- check-disk-usage.rb: Don't blow up when unable to read a filesystem
|
15
|
+
|
16
|
+
### Removed
|
17
|
+
- Remove dependency on `filesystem` gem
|
8
18
|
|
9
19
|
## [1.0.3] - 2015-10-25
|
10
20
|
### Changed
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Sensu-Plugins-disk-checks
|
2
2
|
|
3
|
-
[
|
3
|
+
[](https://travis-ci.org/sensu-plugins/sensu-plugins-disk-checks)
|
4
4
|
[](http://badge.fury.io/rb/sensu-plugins-disk-checks)
|
5
5
|
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-disk-checks)
|
6
6
|
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-disk-checks)
|
@@ -8,14 +8,6 @@
|
|
8
8
|
[](https://codeship.com/projects/76007)
|
9
9
|
## Functionality
|
10
10
|
|
11
|
-
**check-disk-fail**
|
12
|
-
|
13
|
-
Check the output of dmesg for a given set of strings that may correspond to a failure
|
14
|
-
|
15
|
-
**check-disk**
|
16
|
-
|
17
|
-
Check disk capacity and inodes based upon the output of df.
|
18
|
-
|
19
11
|
**check-disk-usage**
|
20
12
|
|
21
13
|
Check disk capacity and inodes based upon the gem sys-filesystem.
|
@@ -36,23 +28,19 @@ You can also visualize the adjustment using
|
|
36
28
|
|
37
29
|
Where P = base percentage, N = normalize factor, and m = magic factor
|
38
30
|
|
39
|
-
**check-fs-writeable**
|
40
|
-
|
41
|
-
Check to make sure a filesytem is writable. This will check both proc and do a smoke test of each given mountpoint. It can also auto-discover mount points in the self namespace.
|
42
|
-
|
43
31
|
**check-fstab-mounts**
|
44
32
|
|
45
33
|
Check the mount points in */etc/fstab* to ensure they are all accounted for.
|
46
34
|
|
47
|
-
**disk-capacity
|
35
|
+
**metrics-disk-capacity**
|
48
36
|
|
49
37
|
Acquire disk capacity metrics from `df` and convert them to a form usable by graphite
|
50
38
|
|
51
|
-
**disk
|
39
|
+
**metrics-disk**
|
52
40
|
|
53
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.
|
54
42
|
|
55
|
-
**disk-
|
43
|
+
**metrics-disk-uasage**
|
56
44
|
|
57
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.
|
58
46
|
|
@@ -65,10 +53,7 @@ Check the SMART status of hardrives and alert based upon a given set of threshol
|
|
65
53
|
Check the health of a disk using `smartctl`
|
66
54
|
|
67
55
|
## Files
|
68
|
-
* bin/check-disk-fail.rb
|
69
|
-
* bin/check-disk.rb
|
70
56
|
* bin/check-disk-usage.rb
|
71
|
-
* bin/check-fs-writable.rb
|
72
57
|
* bin/check-fstab-mounts.rb
|
73
58
|
* bin/check-smart-status.rb
|
74
59
|
* bin/check-smart.rb
|
data/bin/check-disk-usage.rb
CHANGED
@@ -48,6 +48,11 @@ class CheckDisk < Sensu::Plugin::Check::CLI
|
|
48
48
|
description: 'Ignore mount point(s)',
|
49
49
|
proc: proc { |a| a.split(',') }
|
50
50
|
|
51
|
+
option :ignorepathre,
|
52
|
+
short: '-p PATHRE',
|
53
|
+
description: 'Ignore mount point(s) matching regular expression',
|
54
|
+
proc: proc { |a| Regexp.new(a) }
|
55
|
+
|
51
56
|
option :ignoreopt,
|
52
57
|
short: '-o TYPE[.TYPE]',
|
53
58
|
description: 'Ignore option(s)',
|
@@ -113,6 +118,7 @@ class CheckDisk < Sensu::Plugin::Check::CLI
|
|
113
118
|
next if config[:fstype] && !config[:fstype].include?(line.mount_type)
|
114
119
|
next if config[:ignoretype] && config[:ignoretype].include?(line.mount_type)
|
115
120
|
next if config[:ignoremnt] && config[:ignoremnt].include?(line.mount_point)
|
121
|
+
next if config[:ignorepathre] && config[:ignorepathre].match(line.mount_point)
|
116
122
|
next if config[:ignoreopt] && config[:ignoreopt].include?(line.options)
|
117
123
|
rescue
|
118
124
|
unknown 'An error occured getting the mount info'
|
@@ -131,7 +137,12 @@ class CheckDisk < Sensu::Plugin::Check::CLI
|
|
131
137
|
end
|
132
138
|
|
133
139
|
def check_mount(line)
|
134
|
-
|
140
|
+
begin
|
141
|
+
fs_info = Filesystem.stat(line.mount_point)
|
142
|
+
rescue
|
143
|
+
@warn_fs << "#{line.mount_point} Unable to read."
|
144
|
+
return
|
145
|
+
end
|
135
146
|
if fs_info.respond_to?(:inodes) # needed for windows
|
136
147
|
percent_i = percent_inodes(fs_info)
|
137
148
|
if percent_i >= config[:icrit]
|
data/bin/metrics-disk.rb
CHANGED
@@ -18,6 +18,8 @@
|
|
18
18
|
# USAGE:
|
19
19
|
#
|
20
20
|
# NOTES:
|
21
|
+
# Devices can be specifically included or ignored using -i or -I options:
|
22
|
+
# e.g. metrics-disk.rb -I [svx]d[a-z][0-9]*
|
21
23
|
#
|
22
24
|
# LICENSE:
|
23
25
|
# Copyright 2012 Sonian, Inc <chefs@sonian.net>
|
@@ -49,6 +51,18 @@ class DiskGraphite < Sensu::Plugin::Metric::CLI::Graphite
|
|
49
51
|
long: '--convert',
|
50
52
|
default: false
|
51
53
|
|
54
|
+
option :ignore_device,
|
55
|
+
description: 'Ignore devices matching pattern(s)',
|
56
|
+
short: '-i DEV[,DEV]',
|
57
|
+
long: '--ignore-device',
|
58
|
+
proc: proc { |a| a.split(',') }
|
59
|
+
|
60
|
+
option :include_device,
|
61
|
+
description: 'Include only devices matching pattern(s)',
|
62
|
+
short: '-I DEV[,DEV]',
|
63
|
+
long: '--include-device',
|
64
|
+
proc: proc { |a| a.split(',') }
|
65
|
+
|
52
66
|
# Main function
|
53
67
|
def run
|
54
68
|
# http://www.kernel.org/doc/Documentation/iostats.txt
|
@@ -62,6 +76,9 @@ class DiskGraphite < Sensu::Plugin::Metric::CLI::Graphite
|
|
62
76
|
end
|
63
77
|
next if stats == ['0'].cycle.take(stats.size)
|
64
78
|
|
79
|
+
next if config[:ignore_device] && config[:ignore_device].find { |x| dev.match(x) }
|
80
|
+
next if config[:include_device] && !config[:include_device].find { |x| dev.match(x) }
|
81
|
+
|
65
82
|
metrics.size.times { |i| output "#{config[:scheme]}.#{dev}.#{metrics[i]}", stats[i] }
|
66
83
|
end
|
67
84
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-disk-checks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
@@ -30,22 +30,8 @@ cert_chain:
|
|
30
30
|
8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
|
31
31
|
HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-
|
33
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: filesystem
|
37
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - '='
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: 0.1.0
|
42
|
-
type: :runtime
|
43
|
-
prerelease: false
|
44
|
-
version_requirements: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - '='
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: 0.1.0
|
49
35
|
- !ruby/object:Gem::Dependency
|
50
36
|
name: sensu-plugin
|
51
37
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|