README.md
author Mahlon E. Smith <mahlon@martini.nu>
Mon, 02 Sep 2019 08:54:37 -0700
changeset 10 e738ef5f8742
parent 4 1801334b8dc4
permissions -rw-r--r--
Bye, Bitbucket.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     1
# Arborist-fping
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     2
10
e738ef5f8742 Bye, Bitbucket.
Mahlon E. Smith <mahlon@martini.nu>
parents: 4
diff changeset
     3
 * home:
e738ef5f8742 Bye, Bitbucket.
Mahlon E. Smith <mahlon@martini.nu>
parents: 4
diff changeset
     4
   * http://code.martini.nu/Arborist-fping
e738ef5f8742 Bye, Bitbucket.
Mahlon E. Smith <mahlon@martini.nu>
parents: 4
diff changeset
     5
 * mirrors:
e738ef5f8742 Bye, Bitbucket.
Mahlon E. Smith <mahlon@martini.nu>
parents: 4
diff changeset
     6
   * https://github.com/mahlonsmith/Arborist-fping
e738ef5f8742 Bye, Bitbucket.
Mahlon E. Smith <mahlon@martini.nu>
parents: 4
diff changeset
     7
   * https://hg.sr.ht/~mahlon/Arborist-fping
e738ef5f8742 Bye, Bitbucket.
Mahlon E. Smith <mahlon@martini.nu>
parents: 4
diff changeset
     8
 * fping:
e738ef5f8742 Bye, Bitbucket.
Mahlon E. Smith <mahlon@martini.nu>
parents: 4
diff changeset
     9
   * http://fping.org/
0
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    10
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    11
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    12
## Description
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    13
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    14
Arborist is a monitoring toolkit that follows the UNIX philosophy
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    15
of small parts and loose coupling for stability, reliability, and
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    16
customizability.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    17
4
1801334b8dc4 Fix documentation, bump copyright.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    18
This adds fping sweeping support to Arborist monitoring, providing an
1801334b8dc4 Fix documentation, bump copyright.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    19
efficient method to check the ICMP reachability of many, many hosts
0
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    20
simultaneously.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    21
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    22
It requires the fping binary to be installed in your path.  Use your
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    23
package manager of choice.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    24
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    25
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    26
## Prerequisites
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    27
4
1801334b8dc4 Fix documentation, bump copyright.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    28
* Ruby 2.4 or better
0
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    29
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    30
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    31
## Installation
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    32
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    33
    $ gem install arborist-fping
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    34
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    35
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    36
## Usage
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    37
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    38
In this example, we're using ICMP reachability as the method to
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    39
determine if a host node is available/present on network.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    40
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    41
	Arborist::Host( 'example' ) do
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    42
		description "Example host"
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    43
		address     '10.6.0.169'
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    44
	end
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    45
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    46
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    47
From a monitor file, require this library, and exec() to fping.  We'll
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    48
record RTT per node in this example with the -e flag, and lower the
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    49
timeout-per-host:
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    50
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    51
	require 'arborist/monitor/fping'
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    52
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    53
	Arborist::Monitor 'ping check' do
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    54
		every 10.seconds
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    55
		match type: 'host'
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    56
		exec 'fping', '-e', '-t', '150'
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    57
		exec_callbacks( Arborist::Monitor::FPing )
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    58
	end
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    59
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    60
That's it.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    61
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    62
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    63
## License
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    64
4
1801334b8dc4 Fix documentation, bump copyright.
Mahlon E. Smith <mahlon@laika.com>
parents: 0
diff changeset
    65
Copyright (c) 2016-2018, Michael Granger and Mahlon E. Smith
0
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    66
All rights reserved.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    67
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    68
Redistribution and use in source and binary forms, with or without
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    69
modification, are permitted provided that the following conditions are met:
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    70
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    71
* Redistributions of source code must retain the above copyright notice,
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    72
  this list of conditions and the following disclaimer.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    73
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    74
* Redistributions in binary form must reproduce the above copyright notice,
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    75
  this list of conditions and the following disclaimer in the documentation
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    76
  and/or other materials provided with the distribution.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    77
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    78
* Neither the name of the author/s, nor the names of the project's
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    79
  contributors may be used to endorse or promote products derived from this
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    80
  software without specific prior written permission.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    81
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    82
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    83
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    84
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    85
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    86
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    87
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    88
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    89
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    90
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    91
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    92
d99e1dffbc72 Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    93