sensu-plugins-disk-usage 0.0.3 → 0.0.4

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: ae10928d282621491ba2c9a0cae07cd37323d617
4
- data.tar.gz: 50b97067c2f42bf57dbd8c7f3e012998b1d20052
3
+ metadata.gz: 9464861607e96a130759558345d80ed451af6c99
4
+ data.tar.gz: af02291995bdf406409033b15223bd844434ac1b
5
5
  SHA512:
6
- metadata.gz: 64932dc972eb3964313c951241644069c17851fb1aba94f745e7fdfc97547f3d4cf253b27dc1cd4fa13e9492c5ff396f384d1f6f5a721c1a50f693625c737156
7
- data.tar.gz: a2225daf0581b7d3676fea69f5f1979414da731b1f3959cd3c126df0e0565bf3378714d29648dff0f9c7fea155b1afc690a3b28a264f70a7ff9f99379a666fa2
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
 
@@ -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}", "handler" => config[:handler]}
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}", "handler" => config[:handler]}
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}", "handler" => config[:handler]}
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}", "handler" => config[:handler]}
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
 
@@ -2,7 +2,7 @@ module SensuPluginsDiskUsage
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 3
5
+ PATCH = 4
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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.3
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-04 00:00:00.000000000 Z
11
+ date: 2016-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin