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 +4 -4
- data/CHANGELOG.md +7 -2
- data/README.md +1 -0
- data/bin/check-cpu-usage.rb +12 -2
- data/lib/sensu-plugins-cpu-usage/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c5272ad9356b179f92e48057dfa7f3022feab89
|
4
|
+
data.tar.gz: c0a24b4aced06a282c4606d24d1154656c1602cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
##
|
6
|
+
## [0.0.6] - 2016-01-14
|
7
|
+
### Added
|
8
|
+
- Added --dryrun command line option
|
7
9
|
|
8
|
-
## [0.0.
|
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
|
data/bin/check-cpu-usage.rb
CHANGED
@@ -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
|
-
|
87
|
-
|
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)
|