arborist-fping 0.1.0.pre20161005111600

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a90be11588cbc3169c3c29542f0199685fb60804
4
+ data.tar.gz: 12c9c4ee8e86946358b88739abc0c50578e50ea2
5
+ SHA512:
6
+ metadata.gz: e19e2c9794487f50126c5dfb1ef2027db8d8c9908797a6a141441dd8421933d3c5097d782aede531ac2fd79bfb22bee6334788d520eca51133db35b7d55cc3ed
7
+ data.tar.gz: 21149b9a93854402dde2f0cc7698bb0f3d080e64b3cb461b25827ad084e8a6cfad387fe890ef4fb4687bcd7f5a33c389f8f31884b07caef49492d76de5fd56be
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ �z~ ��/����k������f`7ϕ8q`A�g�cFP$�T+��
2
+ �8���
@@ -0,0 +1,64 @@
1
+ # -*- ruby -*-
2
+ # vim: set noet nosta sw=4 ts=4 :
3
+ # encoding: utf-8
4
+ #
5
+ # This library parses fping output when provided a list of nodes to
6
+ # monitor. Require it from your monitor file(s), and call the Arborist
7
+ # exec() with this class -- that's it.
8
+ #
9
+ # require 'arborist/monitor/fping'
10
+ #
11
+ # Arborist::Monitor 'ping check' do
12
+ # every 20.seconds
13
+ # match type: 'host'
14
+ # include_down true
15
+ # use :addresses
16
+ # exec 'fping', '-e', '-t', '150'
17
+ # exec_callbacks( Arborist::Monitor::FPing )
18
+ # end
19
+
20
+
21
+ require 'loggability'
22
+ require 'arborist/monitor' unless defined?( Arborist::Monitor )
23
+
24
+ # Parse Fping output for better batch ICMP checks.
25
+ #
26
+ module Arborist::Monitor::FPing
27
+ extend Loggability
28
+ log_to :arborist
29
+
30
+ # The version of this library.
31
+ VERSION = '0.1.0'
32
+
33
+ attr_accessor :identifiers
34
+
35
+ def exec_arguments( nodes )
36
+ self.log.debug "Building fping arguments for %d nodes" % [ nodes.size ]
37
+ self.identifiers = nodes.each_with_object({}) do |(identifier, props), hash|
38
+ next unless props.key?( 'addresses' )
39
+ address = props[ 'addresses' ].first
40
+ hash[ address ] = identifier
41
+ end
42
+
43
+ return {} if self.identifiers.empty?
44
+ return self.identifiers.keys
45
+ end
46
+
47
+ def handle_results( pid, stdout, stderr )
48
+ # 8.8.8.8 is alive (32.1 ms)
49
+ # 8.8.4.4 is alive (14.9 ms)
50
+ # 8.8.0.1 is unreachable
51
+
52
+ return stdout.each_line.with_object({}) do |line, hash|
53
+ address, remainder = line.split( ' ', 2 )
54
+ identifier = self.identifiers[ address ] or next
55
+
56
+ if remainder =~ /is alive \((\d+\.\d+) ms\)/
57
+ hash[ identifier ] = { rtt: Float( $1 ) }
58
+ else
59
+ hash[ identifier ] = { error: remainder.chomp }
60
+ end
61
+ end
62
+ end
63
+ end # Arborist::Monitor::FPing
64
+
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arborist-fping
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.pre20161005111600
5
+ platform: ruby
6
+ authors:
7
+ - Mahlon E. Smith <mahlon@martini.nu>
8
+ - Michael Granger <ged@faeriemud.org>
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIDbDCCAlSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA+MQ8wDQYDVQQDDAZtYWhs
15
+ b24xFzAVBgoJkiaJk/IsZAEZFgdtYXJ0aW5pMRIwEAYKCZImiZPyLGQBGRYCbnUw
16
+ HhcNMTYwNjI5MjMzMzI2WhcNMTcwNjI5MjMzMzI2WjA+MQ8wDQYDVQQDDAZtYWhs
17
+ b24xFzAVBgoJkiaJk/IsZAEZFgdtYXJ0aW5pMRIwEAYKCZImiZPyLGQBGRYCbnUw
18
+ ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDpXGN0YbMVpYv4EoiCxpQw
19
+ sxKdyhlkvpvENUkpEhbpnEuMKXgUfRHO4T/vBZf0h8eYgwnrHCRhAeIqesFKfoj9
20
+ mpEJk5JUuADOAz18aT+v24UqAtJdiwBJLuqhslSNB6CFXZv3OOMny9bjoJegz0hI
21
+ Fht9ppCuNmxJNd+L3zAX8lD01RUWNRC+8L5QLCjViJtjFDDCFfh9NCirs+XnTCzo
22
+ AJgFbsZIzFJtSiXUtFgscKr4Ik8ruhRbPbYbmx9rf6W74aTMPxggq/d3gj0Eh32y
23
+ WsXsQ5giVnmkbsRkBNu3QyZ8Xr5+7mvy5AWyqXKOrcW7lnYaob6Z9x/MGXGNeD6j
24
+ AgMBAAGjdTBzMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRY8ea6
25
+ +6kAaW7ukKph2/4MTAD8/TAcBgNVHREEFTATgRFtYWhsb25AbWFydGluaS5udTAc
26
+ BgNVHRIEFTATgRFtYWhsb25AbWFydGluaS5udTANBgkqhkiG9w0BAQUFAAOCAQEA
27
+ EU39m2ZKYqAAu71bwjWl5zEAk0aE4ojMLIMWpWE6IwCr9FZVpC1B+LyEboWFljId
28
+ R0udISkfM+kQ3FRzmnwwQLaYJyhDPEWbQ1O6P6wHCaUQ23A1P++dZf8PWuZkS6Dn
29
+ C1q7Zq4EAZEBLUSK69iPP4jCLjIp3YBQ88D1/egA+hkrR/19m236PvhhaM9FTgQv
30
+ LtL61M3ZtlTanoXiNbXRXwRnODzvjFpQRiiBiazCDBYj8oYDsNj+qNw/iZlZlzw5
31
+ F6uYXeS4YCZP453ZcpgZkXo3F5RheTrkdf04DMwUpQPMKog9QmRSTlCxzH69kivQ
32
+ IfRp+58YwWwtAIQPZoY6Rg==
33
+ -----END CERTIFICATE-----
34
+ date: 2016-10-05 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: arborist
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ description: "\tThis library adds fping output parsing support to Arborist monitors.\n"
51
+ email: mahlon@martini.nu
52
+ executables: []
53
+ extensions: []
54
+ extra_rdoc_files: []
55
+ files:
56
+ - lib/arborist/monitor/fping.rb
57
+ homepage: http://bitbucket.org/mahlon/Arborist-fping
58
+ licenses:
59
+ - BSD-3-Clause
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '2'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">"
73
+ - !ruby/object:Gem::Version
74
+ version: 1.3.1
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.5.1
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Efficient ping strobing for Arborist
81
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,2 @@
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�