sensu-plugins-disk-usage 0.0.3 → 0.0.4
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
- data/CHANGELOG.md +4 -0
- data/README.md +3 -0
- data/bin/check-disk-usage.rb +10 -4
- data/lib/sensu-plugins-disk-usage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9464861607e96a130759558345d80ed451af6c99
|
4
|
+
data.tar.gz: af02291995bdf406409033b15223bd844434ac1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b51e0883039413710d60d4c149cafe7babc12c0bcb5b008e5002e17cdb541fb390626c0a1ddddf88462d1ecf5fc024dd60b2598b9b6f962869a894f22c853cbd
|
7
|
+
data.tar.gz: 72f6e69b62ab9f86bf556aebf062bb9b105a9b95a7ea799861c6030c49fa82f897ee7657e4b89eb27e0f85c33a5c7bd3e1cb29814b042fdff265f1f2e2e03f31
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
5
5
|
|
6
6
|
## Unreleased
|
7
7
|
|
8
|
+
## [0.0.4] - 2016-01-14
|
9
|
+
### Added
|
10
|
+
- Added --handlers command line option
|
11
|
+
|
8
12
|
## [0.0.2] - 2015-12-29
|
9
13
|
### Added
|
10
14
|
- Added missing sys-filesystem dependency
|
data/README.md
CHANGED
@@ -15,6 +15,7 @@ Usage: check-disk-usage.rb (options)
|
|
15
15
|
--crit-inodes <PERCENT> Critical if PERCENT or more of inodes used
|
16
16
|
--crit-space <PERCENT> Critical if PERCENT or more of disk space used
|
17
17
|
--fstype <TYPE> Comma separated list of file system type(s) (default: all)
|
18
|
+
--handlers <HANDLERS> Comma separated list of handlers
|
18
19
|
--ignore-fstype <TYPE> Comma separated list of file system type(s) to ignore
|
19
20
|
--ignore-mount <MOUNTPOINT> Comma separated list of mount point(s) to ignore
|
20
21
|
--ignore-mount-regex <MOUNTPOINT>
|
@@ -26,6 +27,8 @@ Usage: check-disk-usage.rb (options)
|
|
26
27
|
--warn-space <PERCENT> Warn if PERCENT or more of disk space used
|
27
28
|
```
|
28
29
|
|
30
|
+
Use the --handlers command line option to specify which handlers you want to use for the generated events.
|
31
|
+
|
29
32
|
By default, the warning and critical parameters are global to all mountpoints. However, each mountpoint can override the defaults in an optional JSON configuration file which must be placed
|
30
33
|
in the same location as the plugin.
|
31
34
|
|
data/bin/check-disk-usage.rb
CHANGED
@@ -77,6 +77,12 @@ class CheckDiskUsage < Sensu::Plugin::Check::CLI
|
|
77
77
|
:proc => proc(&:to_i),
|
78
78
|
:default => 95
|
79
79
|
|
80
|
+
option :handlers,
|
81
|
+
:description => "Comma separated list of handlers",
|
82
|
+
:long => "--handlers <HANDLER>",
|
83
|
+
:proc => proc { |s| s.split(',') },
|
84
|
+
:default => []
|
85
|
+
|
80
86
|
option :warn,
|
81
87
|
:description => "Warn instead of throwing a critical failure",
|
82
88
|
:short => "-w",
|
@@ -149,22 +155,22 @@ class CheckDiskUsage < Sensu::Plugin::Check::CLI
|
|
149
155
|
end
|
150
156
|
|
151
157
|
def send_ok(check_name, msg)
|
152
|
-
event = {"name" => check_name, "status" => 0, "output" => "OK: #{msg}", "
|
158
|
+
event = {"name" => check_name, "status" => 0, "output" => "#{self.class.name} OK: #{msg}", "handlers" => config[:handlers]}
|
153
159
|
send_client_socket(event.to_json)
|
154
160
|
end
|
155
161
|
|
156
162
|
def send_warning(check_name, msg)
|
157
|
-
event = {"name" => check_name, "status" => 1, "output" => "WARNING: #{msg}", "
|
163
|
+
event = {"name" => check_name, "status" => 1, "output" => "#{self.class.name} WARNING: #{msg}", "handlers" => config[:handlers]}
|
158
164
|
send_client_socket(event.to_json)
|
159
165
|
end
|
160
166
|
|
161
167
|
def send_critical(check_name, msg)
|
162
|
-
event = {"name" => check_name, "status" => 2, "output" => "CRITICAL: #{msg}", "
|
168
|
+
event = {"name" => check_name, "status" => 2, "output" => "#{self.class.name} CRITICAL: #{msg}", "handlers" => config[:handlers]}
|
163
169
|
send_client_socket(event.to_json)
|
164
170
|
end
|
165
171
|
|
166
172
|
def send_unknown(check_name, msg)
|
167
|
-
event = {"name" => check_name, "status" => 3, "output" => "UNKNOWN: #{msg}", "
|
173
|
+
event = {"name" => check_name, "status" => 3, "output" => "#{self.class.name} UNKNOWN: #{msg}", "handlers" => config[:handlers]}
|
168
174
|
send_client_socket(event.to_json)
|
169
175
|
end
|
170
176
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-disk-usage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matteo Cerutti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|