sensu-plugins-network-checks 3.1.2 → 3.2.0

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
  SHA256:
3
- metadata.gz: 67ece744d89b4bdab8521f381a0b4837c1f7020878c0da49e34f0e6e9a150f5f
4
- data.tar.gz: 9da8c395ff2203f393f8137e8dc0bb3a15201ac5c7b3d06d37c0c2e9175d2688
3
+ metadata.gz: 75dc1fbc317bd118f4c23b73c9f205252f45d172596908b550370ecfa14ec8b2
4
+ data.tar.gz: e9b7b2a8bf61206636614c54e225f363ccf50df58d6060821ea5c8dd53daefbf
5
5
  SHA512:
6
- metadata.gz: fe69ae155c1e3d776c8cdf0858d61d2820d109a9fc868d6b15e8da0551079c3af824c6fecd8ca0bfaac31d5df275254b1e670369399ddb1ed854b80876a6cd42
7
- data.tar.gz: 30f01c5500bc9e22ff4b5813425eb97615f23c99fe4f3623b70236fed8a1c4f6fd3408b251e634d16a079f7ba171278c01da75aa2a455ec1b0ac66320114f767
6
+ metadata.gz: b5075fbdc1d8d2b318be88ea2a1b606fdb3b8d4be30e38a01fb08b78d250eb46b9dff104ec0b619c86a73491e60c2c253ea504db51f69a83d1fffc8ecb50546f
7
+ data.tar.gz: e1be3fb72df400fc60da02bc021b606a5af127b77c1162bd67c2e0710d22718e6bba0ec869d586dc67038f4056f5331b09010b6acb594644ba9f074b285ac09c
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugin
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [3.2.0] - 2018-08-06
9
+ ### Added
10
+ - metrics-net.rb: allow including only interfaces whos status is `up` (@johannagnarsson)
11
+
8
12
  ## [3.1.2] - 2018-06-10
9
13
  ### Fixed
10
14
  - metrics-netif.rb: allow you to actually pass in a value for `--average-key` (@scones)
@@ -224,7 +228,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugin
224
228
 
225
229
  * initial release, same as community repo
226
230
 
227
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-network-checks/compare/3.1.2...HEAD
231
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-network-checks/compare/3.2.0...HEAD
232
+ [3.2.0]: https://github.com/sensu-plugins/sensu-plugins-network-checks/compare/3.1.2...3.2.0
228
233
  [3.1.2]: https://github.com/sensu-plugins/sensu-plugins-network-checks/compare/3.1.1...3.1.2
229
234
  [3.1.1]: https://github.com/sensu-plugins/sensu-plugins-network-checks/compare/3.1.0...3.1.1
230
235
  [3.1.0]: https://github.com/sensu-plugins/sensu-plugins-network-checks/compare/3.0.0...3.1.0
data/bin/metrics-net.rb CHANGED
@@ -73,6 +73,11 @@ class LinuxPacketMetrics < Sensu::Plugin::Metric::CLI::Graphite
73
73
  long: '--include-device',
74
74
  proc: proc { |a| a.split(',') }
75
75
 
76
+ option :only_up,
77
+ description: 'Include only devices whose interface status is up',
78
+ short: '-u',
79
+ long: '--only-up'
80
+
76
81
  def run
77
82
  timestamp = Time.now.to_i
78
83
 
@@ -83,6 +88,7 @@ class LinuxPacketMetrics < Sensu::Plugin::Metric::CLI::Graphite
83
88
 
84
89
  next if config[:ignore_device] && config[:ignore_device].find { |x| iface.match(x) }
85
90
  next if config[:include_device] && !config[:include_device].find { |x| iface.match(x) }
91
+ next if config[:only_up] && File.open(iface_path + '/operstate').read.strip != 'up'
86
92
 
87
93
  tx_pkts = File.open(iface_path + '/statistics/tx_packets').read.strip
88
94
  rx_pkts = File.open(iface_path + '/statistics/rx_packets').read.strip
@@ -3,8 +3,8 @@
3
3
  module SensuPluginsNetworkChecks
4
4
  module Version
5
5
  MAJOR = 3
6
- MINOR = 1
7
- PATCH = 2
6
+ MINOR = 2
7
+ PATCH = 0
8
8
 
9
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-network-checks
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-10 00:00:00.000000000 Z
11
+ date: 2018-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin