sensu-plugins-cpu-usage 0.0.4 → 0.0.5

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: 1d2c26c4afefe436edfc88fce5e4b83b9993776c
4
- data.tar.gz: a5587cb30a0838015a8c5e5674fe712339973f50
3
+ metadata.gz: c01cf9f6f2145599e43be96ebb701239ed00894b
4
+ data.tar.gz: a061aa19b4d7f6c3f2ff59d8cd9a50581db0cff8
5
5
  SHA512:
6
- metadata.gz: 45e89b1bc296ff75e134f0d20d999864c7288b4d9fab566ac3226441acf542875ec24ed563d24f7436e8a22b5305ee4ddcbd36c59491c1027af5f079e0c54042
7
- data.tar.gz: d2fcdfc4c59a9be114d23969374c27a251e042e1cc4e941bb84cec904c23045d18f00cdc216626d22336a523db45fdca907b5c9f786c91190d3f2cd2242022ea
6
+ metadata.gz: 5c59c23f8776673405e8357e2b84355d1a498c1752e244d80940b629ab9db10545195734d1796eb48bc37186be93508fd0dc4546644f80c0bd9c951513fda8c6
7
+ data.tar.gz: bac4c77e6217086a4623c861bc826fdd54222e55dbf814cf6c385901ed68bb9d76be12952fa0625b6288dd26c99854ce3adab0a164930aea4b181668fec35709
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.4] - 2016-01-05
9
13
  ### Added
10
14
  - Should be :ignore_metric
data/README.md CHANGED
@@ -22,6 +22,7 @@ Usage: check-cpu-usage.rb (options)
22
22
  --crit-steal <USAGE> Critical if USAGE exceeds the current system steal usage
23
23
  --crit-system <USAGE> Critical if USAGE exceeds the current system system usage
24
24
  --crit-user <USAGE> Critical if USAGE exceeds the current system user usage
25
+ --handlers <HANDLERS> Comma separated list of handlers
25
26
  -i <user,nice,system,idle,iowait,irq,softirq,steal,guest,guest_nice>,
26
27
  --ignore-metric Comma separated list of metrics to ignore
27
28
  -m <user,nice,system,idle,iowait,irq,softirq,steal,guest,guest_nice>,
@@ -42,5 +43,7 @@ Usage: check-cpu-usage.rb (options)
42
43
 
43
44
  By default, all metrics are taken into consideration when calculating the overall cpu usage.
44
45
 
46
+ Use the --handlers command line option to specify which handlers you want to use for the generated events.
47
+
45
48
  ## Author
46
49
  Matteo Cerutti - <matteo.cerutti@hotmail.co.uk>
@@ -47,6 +47,12 @@ class CheckCpuUsage < Sensu::Plugin::Check::CLI
47
47
  :default => 1,
48
48
  :proc => proc(&:to_i)
49
49
 
50
+ option :handlers,
51
+ :description => "Comma separated list of handlers",
52
+ :long => "--handlers <HANDLER>",
53
+ :proc => proc { |s| s.split(',') },
54
+ :default => []
55
+
50
56
  option :warn,
51
57
  :description => "Warn if USAGE exceeds the overall system cpu usage (default: 80)",
52
58
  :short => "-w <USAGE>",
@@ -82,22 +88,22 @@ class CheckCpuUsage < Sensu::Plugin::Check::CLI
82
88
  end
83
89
 
84
90
  def send_ok(check_name, msg)
85
- event = {"name" => check_name, "status" => 0, "output" => "OK: #{msg}", "handler" => config[:handler]}
91
+ event = {"name" => check_name, "status" => 0, "output" => "#{self.class.name} OK: #{msg}", "handlers" => config[:handlers]}
86
92
  send_client_socket(event.to_json)
87
93
  end
88
94
 
89
95
  def send_warning(check_name, msg)
90
- event = {"name" => check_name, "status" => 1, "output" => "WARNING: #{msg}", "handler" => config[:handler]}
96
+ event = {"name" => check_name, "status" => 1, "output" => "#{self.class.name} WARNING: #{msg}", "handlers" => config[:handlers]}
91
97
  send_client_socket(event.to_json)
92
98
  end
93
99
 
94
100
  def send_critical(check_name, msg)
95
- event = {"name" => check_name, "status" => 2, "output" => "CRITICAL: #{msg}", "handler" => config[:handler]}
101
+ event = {"name" => check_name, "status" => 2, "output" => "#{self.class.name} CRITICAL: #{msg}", "handlers" => config[:handlers]}
96
102
  send_client_socket(event.to_json)
97
103
  end
98
104
 
99
105
  def send_unknown(check_name, msg)
100
- event = {"name" => check_name, "status" => 3, "output" => "UNKNOWN: #{msg}", "handler" => config[:handler]}
106
+ event = {"name" => check_name, "status" => 3, "output" => "#{self.class.name} UNKNOWN: #{msg}", "handlers" => config[:handlers]}
101
107
  send_client_socket(event.to_json)
102
108
  end
103
109
 
@@ -2,7 +2,7 @@ module SensuPluginsCpuUsage
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 4
5
+ PATCH = 5
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-cpu-usage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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-05 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