arborist-fping 0.1.0.pre20161005111600 → 0.1.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
  SHA1:
3
- metadata.gz: a90be11588cbc3169c3c29542f0199685fb60804
4
- data.tar.gz: 12c9c4ee8e86946358b88739abc0c50578e50ea2
3
+ metadata.gz: dd044ced90b9cd42f59a9498fac6a2005dfa3242
4
+ data.tar.gz: 0ec06629ed551eb930409ecfda56138002f186e0
5
5
  SHA512:
6
- metadata.gz: e19e2c9794487f50126c5dfb1ef2027db8d8c9908797a6a141441dd8421933d3c5097d782aede531ac2fd79bfb22bee6334788d520eca51133db35b7d55cc3ed
7
- data.tar.gz: 21149b9a93854402dde2f0cc7698bb0f3d080e64b3cb461b25827ad084e8a6cfad387fe890ef4fb4687bcd7f5a33c389f8f31884b07caef49492d76de5fd56be
6
+ metadata.gz: 55cc350099fb58806960948ad70f0cc0216b267b2d96c08e4e39bb3a28d160cc9c81088e083df711d9e8b51c0036f1f49516de5e7acb89caac8848c774adf8d3
7
+ data.tar.gz: ec5271b4184b29e3efc03e78018030fec6e5a6e5097e9b02612441f026dc4906e263b3d501a8df783ac4b19f3e3c5d9c931ed261dd2e45ed1a9d9abf0e6b2d01
@@ -11,8 +11,6 @@
11
11
  # Arborist::Monitor 'ping check' do
12
12
  # every 20.seconds
13
13
  # match type: 'host'
14
- # include_down true
15
- # use :addresses
16
14
  # exec 'fping', '-e', '-t', '150'
17
15
  # exec_callbacks( Arborist::Monitor::FPing )
18
16
  # end
@@ -30,30 +28,47 @@ module Arborist::Monitor::FPing
30
28
  # The version of this library.
31
29
  VERSION = '0.1.0'
32
30
 
31
+ # Always request the node addresses.
32
+ USED_PROPERTIES = [ :addresses ].freeze
33
+
34
+ ### Return the properties used by this monitor.
35
+ def self::node_properties
36
+ return USED_PROPERTIES
37
+ end
38
+
33
39
  attr_accessor :identifiers
34
40
 
35
- def exec_arguments( nodes )
36
- self.log.debug "Building fping arguments for %d nodes" % [ nodes.size ]
41
+ ### Arborist::Monitor API: Send addresses to the fping binary, after
42
+ ### creating a map to re-associate them back to identifiers.
43
+ ###
44
+ def exec_input( nodes, io )
45
+ self.log.debug "Building fping input for %d nodes" % [ nodes.size ]
37
46
  self.identifiers = nodes.each_with_object({}) do |(identifier, props), hash|
38
47
  next unless props.key?( 'addresses' )
39
48
  address = props[ 'addresses' ].first
40
49
  hash[ address ] = identifier
41
50
  end
42
51
 
43
- return {} if self.identifiers.empty?
44
- return self.identifiers.keys
52
+ return if self.identifiers.empty?
53
+
54
+ self.identifiers.keys.each{|ip| io.puts(ip) }
45
55
  end
46
56
 
57
+
58
+ ### Parse fping output, return a hash of RTT data, along
59
+ ### with any detected errors.
60
+ ###
47
61
  def handle_results( pid, stdout, stderr )
48
62
  # 8.8.8.8 is alive (32.1 ms)
49
63
  # 8.8.4.4 is alive (14.9 ms)
64
+ # 1.1.1.1 is alive (236 ms)
50
65
  # 8.8.0.1 is unreachable
51
66
 
52
67
  return stdout.each_line.with_object({}) do |line, hash|
53
68
  address, remainder = line.split( ' ', 2 )
54
69
  identifier = self.identifiers[ address ] or next
55
70
 
56
- if remainder =~ /is alive \((\d+\.\d+) ms\)/
71
+ if remainder =~ /is alive \((\d+(?:\.\d+)?) ms\)/
57
72
  hash[ identifier ] = { rtt: Float( $1 ) }
58
73
  else
59
74
  hash[ identifier ] = { error: remainder.chomp }
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arborist-fping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre20161005111600
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Mahlon E. Smith <mahlon@martini.nu>
8
- - Michael Granger <ged@faeriemud.org>
7
+ - Mahlon E. Smith
8
+ - Michael Granger
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
@@ -13,7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kXo3F5RheTrkdf04DMwUpQPMKog9QmRSTlCxzH69kivQ
32
- IfRp+58YwWwtAIQPZoY6Rg==
27
+ 00FljTeSNaYUqJ59yLRA+i43wVNiO4ETQQu6fYQCPns12Sm90spOJb3SmTDkJ7CY
28
+ dixOQg5A3Et1LVS+Z/YfH1TAbb50oTWbZbTW2JknHS0hohq3UF1pvbkk1niZ26er
29
+ skJ352MUfcyaUkQyMmCjL/BpkDutYH5OCGh+FmK8+mH7SoC9Nr48WwH2prVdHs3y
30
+ OMWFgB33sXdj1XqOd2Rw1WPgAeMeDqWeIrRMpUhNZOwroaA1MAr60f9NIYxua/vx
31
+ n0YyneERGuHPSRZFgo72tGOqLpAlWnhPxRNqnayZmsg3hPPI87B6MTUI2UQ7VUdh
32
+ UrSf3b+cPoC8PNfjp8zsdw==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-10-05 00:00:00.000000000 Z
34
+ date: 2018-06-13 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: arborist
@@ -39,16 +39,18 @@ dependencies:
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0'
42
+ version: '0.1'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '0'
49
+ version: '0.1'
50
50
  description: "\tThis library adds fping output parsing support to Arborist monitors.\n"
51
- email: mahlon@martini.nu
51
+ email:
52
+ - mahlon@martini.nu
53
+ - ged@faeriemud.org
52
54
  executables: []
53
55
  extensions: []
54
56
  extra_rdoc_files: []
@@ -69,12 +71,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
71
  version: '2'
70
72
  required_rubygems_version: !ruby/object:Gem::Requirement
71
73
  requirements:
72
- - - ">"
74
+ - - ">="
73
75
  - !ruby/object:Gem::Version
74
- version: 1.3.1
76
+ version: '0'
75
77
  requirements: []
76
78
  rubyforge_project:
77
- rubygems_version: 2.5.1
79
+ rubygems_version: 2.5.2.1
78
80
  signing_key:
79
81
  specification_version: 4
80
82
  summary: Efficient ping strobing for Arborist
@@ -1,2 +0,0 @@
1
- �z~ ��/����k������f`7ϕ8q`A�g�cFP$�T+��
2
- �8���
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- tLߪb��LQ�-�RG��MH�6,�e�,z�M��BeYK�(1
2
-  �:F��v�Z#�y��7��̿m��CJ�{�Ǣ���|ob�Nn��ȧ ��#8��o�R8���vK��[�#Q� �J�(�jj�L��@����Pʽ��a���{���d�-"��U�Ma�