sensu-plugins-network-interface 0.1.13 → 0.1.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41584da6ca07b1067d63b6c5aa13007ab1590a8f
4
- data.tar.gz: 08d3ec3d3d8f952eb6debf24949463fced9cf26c
3
+ metadata.gz: 0a3a3ecf10b5aa55e81ab9a199260a01d6b655b6
4
+ data.tar.gz: e894a8dbf15f5492d4afdc630bbb1922a2005ec2
5
5
  SHA512:
6
- metadata.gz: ec9fcf70f26b9f0fc0c5071e1079d676da6cb441947dca2e84fd224bf4c46bfd377a530b289998a4aca169d249e5935cac702de157439526808ee7e53656b9cd
7
- data.tar.gz: a8e248c9b56868f7e3950ddd695cae56183d0cc6960d94a6a4bd890e69fba753b709a66e484c81af1ddcb5a1b26b79e2d20576abd601814d4e56c90bdb6c2f2e
6
+ metadata.gz: f3b1072a2d9ee3228e4a8d724dd5c2c514609486ed3c408b9417684e326ff87cc13d38a3a7a4b194c7abcba69ff7a8ccfa4edd0967eba4d6b8e89fda5e924d0d
7
+ data.tar.gz: 01a9531a48e28648e2c1640c13561a793c4fb72e27e8c288a014cb7be7069c444f4ca9ab047a314e261fef958d15feca375851a12179cc153c936af8c65442ec
data/CHANGELOG.md CHANGED
@@ -3,7 +3,9 @@ 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.1.15] - 2016-01-14
7
+ ### Added
8
+ - Added --handlers command line option
7
9
 
8
10
  ## [0.1.14] - 2016-01-08
9
11
  ### Added
@@ -57,3 +59,6 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
57
59
  ## [0.1.1] - 2015-12-28
58
60
  ### Added
59
61
  - Initial release
62
+
63
+ ## Unreleased
64
+
data/README.md CHANGED
@@ -18,6 +18,7 @@ Usage: check-network-interface.rb (options)
18
18
  -x <INTERFACES>, Comma separated list of interfaces to ignore
19
19
  --ignore-interface
20
20
  -i, --interface <INTERFACES> Comma separated list of interfaces to check (default: ALL)
21
+ --handlers <HANDLERS> Comma separated list of handlers
21
22
  -m, --mtu <MTU> Message Transfer Unit
22
23
  --operstate <STATE> Indicates the interface RFC2863 operational state (default: up)
23
24
  -s, --speed <SPEED> Expected speed in Mb/s
@@ -25,6 +26,8 @@ Usage: check-network-interface.rb (options)
25
26
  -w, --warn Warn instead of throwing a critical failure
26
27
  ```
27
28
 
29
+ Use the --handlers command line option to specify which handlers you want to use for the generated events.
30
+
28
31
  The --interface and --ignore-interface parameters can also accept regular expressions.
29
32
 
30
33
  When no interface is specified, the plugin will monitor all interfaces that are found under /sys/class/net as well as those set up under /etc/sysconfig/network-scripts/ifcfg-\*.
@@ -70,6 +70,12 @@ class CheckNetworkInterface < Sensu::Plugin::Check::CLI
70
70
  :in => ["down", "up"],
71
71
  :default => "up"
72
72
 
73
+ option :handlers,
74
+ :description => "Comma separated list of handlers",
75
+ :long => "--handlers <HANDLER>",
76
+ :proc => proc { |s| s.split(',') },
77
+ :default => []
78
+
73
79
  option :warn,
74
80
  :description => "Warn instead of throwing a critical failure",
75
81
  :short => "-w",
@@ -149,22 +155,22 @@ class CheckNetworkInterface < 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 SensuPluginsNetworkInterface
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 13
5
+ PATCH = 15
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-network-interface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.15
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-08 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