arborist-fping 0.1.0.pre20161005111600 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arborist/monitor/fping.rb +22 -7
- metadata +19 -17
- checksums.yaml.gz.sig +0 -2
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd044ced90b9cd42f59a9498fac6a2005dfa3242
|
4
|
+
data.tar.gz: 0ec06629ed551eb930409ecfda56138002f186e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
36
|
-
|
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
|
44
|
-
|
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
|
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
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Mahlon E. Smith
|
8
|
-
- Michael Granger
|
7
|
+
- Mahlon E. Smith
|
8
|
+
- Michael Granger
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
@@ -13,7 +13,7 @@ cert_chain:
|
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
14
|
MIIDbDCCAlSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA+MQ8wDQYDVQQDDAZtYWhs
|
15
15
|
b24xFzAVBgoJkiaJk/IsZAEZFgdtYXJ0aW5pMRIwEAYKCZImiZPyLGQBGRYCbnUw
|
16
|
-
|
16
|
+
HhcNMTcxMTIyMjIyMTAyWhcNMTgxMTIyMjIyMTAyWjA+MQ8wDQYDVQQDDAZtYWhs
|
17
17
|
b24xFzAVBgoJkiaJk/IsZAEZFgdtYXJ0aW5pMRIwEAYKCZImiZPyLGQBGRYCbnUw
|
18
18
|
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDpXGN0YbMVpYv4EoiCxpQw
|
19
19
|
sxKdyhlkvpvENUkpEhbpnEuMKXgUfRHO4T/vBZf0h8eYgwnrHCRhAeIqesFKfoj9
|
@@ -24,14 +24,14 @@ cert_chain:
|
|
24
24
|
AgMBAAGjdTBzMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRY8ea6
|
25
25
|
+6kAaW7ukKph2/4MTAD8/TAcBgNVHREEFTATgRFtYWhsb25AbWFydGluaS5udTAc
|
26
26
|
BgNVHRIEFTATgRFtYWhsb25AbWFydGluaS5udTANBgkqhkiG9w0BAQUFAAOCAQEA
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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:
|
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:
|
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:
|
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
|
checksums.yaml.gz.sig
DELETED
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED