sensu-plugins-cpu-usage 0.0.5 → 0.0.6

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: c01cf9f6f2145599e43be96ebb701239ed00894b
4
- data.tar.gz: a061aa19b4d7f6c3f2ff59d8cd9a50581db0cff8
3
+ metadata.gz: 7c5272ad9356b179f92e48057dfa7f3022feab89
4
+ data.tar.gz: c0a24b4aced06a282c4606d24d1154656c1602cf
5
5
  SHA512:
6
- metadata.gz: 5c59c23f8776673405e8357e2b84355d1a498c1752e244d80940b629ab9db10545195734d1796eb48bc37186be93508fd0dc4546644f80c0bd9c951513fda8c6
7
- data.tar.gz: bac4c77e6217086a4623c861bc826fdd54222e55dbf814cf6c385901ed68bb9d76be12952fa0625b6288dd26c99854ce3adab0a164930aea4b181668fec35709
6
+ metadata.gz: 600a0ab43a8cff0501c37688fc96c0d5c49f68e14f9f7eb3f3a262366f1e5e599a391b18fa622079a8a1758015fbc61ed41a950592806df995eb2ec5be186811
7
+ data.tar.gz: db1600e3c71797aec60b2fec0a483744311319fd5e1bd549f15653c59e13230796244c6d3068a7a9eacfd4f2fa9b9eadf0ff678728455166afe75a9d5631cd3d
data/CHANGELOG.md CHANGED
@@ -3,9 +3,11 @@ 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
- ## Unreleased
6
+ ## [0.0.6] - 2016-01-14
7
+ ### Added
8
+ - Added --dryrun command line option
7
9
 
8
- ## [0.0.4] - 2016-01-14
10
+ ## [0.0.5] - 2016-01-14
9
11
  ### Added
10
12
  - Added --handlers command line option
11
13
 
@@ -24,3 +26,6 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
24
26
  ## [0.0.1] - 2016-01-05
25
27
  ### Added
26
28
  - Initial release
29
+
30
+ ## Unreleased
31
+
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
+ --dryrun Do not send events to sensu client socket
25
26
  --handlers <HANDLERS> Comma separated list of handlers
26
27
  -i <user,nice,system,idle,iowait,irq,softirq,steal,guest,guest_nice>,
27
28
  --ignore-metric Comma separated list of metrics to ignore
@@ -67,6 +67,12 @@ class CheckCpuUsage < Sensu::Plugin::Check::CLI
67
67
  :default => 90,
68
68
  :proc => proc(&:to_i)
69
69
 
70
+ option :dryrun,
71
+ :description => "Do not send events to sensu client socket",
72
+ :long => "--dryrun",
73
+ :boolean => true,
74
+ :default => false
75
+
70
76
  def initialize()
71
77
  super
72
78
 
@@ -83,8 +89,12 @@ class CheckCpuUsage < Sensu::Plugin::Check::CLI
83
89
  end
84
90
 
85
91
  def send_client_socket(data)
86
- sock = UDPSocket.new
87
- sock.send(data + "\n", 0, "127.0.0.1", 3030)
92
+ if config[:dryrun]
93
+ puts data.inspect
94
+ else
95
+ sock = UDPSocket.new
96
+ sock.send(data + "\n", 0, "127.0.0.1", 3030)
97
+ end
88
98
  end
89
99
 
90
100
  def send_ok(check_name, msg)
@@ -2,7 +2,7 @@ module SensuPluginsCpuUsage
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 5
5
+ PATCH = 6
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-cpu-usage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Cerutti