From 50027ec16cee4853174c0c9d67aff685ebfbd03d Mon Sep 17 00:00:00 2001 From: Thomas Bellman <bellman@lysator.liu.se> Date: Thu, 3 Jan 2019 15:00:48 +0100 Subject: [PATCH] Proper help text for check_ping_multiaddr plugin. --- check_ping_multiaddr.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/check_ping_multiaddr.py b/check_ping_multiaddr.py index 9e57990..dee53a7 100755 --- a/check_ping_multiaddr.py +++ b/check_ping_multiaddr.py @@ -9,7 +9,32 @@ __doc__ = """\ Check that one or more IP addresses responds to ping. -Both IPv4 and IPv6 can be checked at the same time. +The intent of this Nagios plugin is to check that a host is alive and +reachable on all of its addresses, in particular both IPv4 and IPv6 +addresses, which can be tested at the same time. + +Addresses can be specified either as numeric IP addresses, or as host +names that will be resolved at runtime. By default, only the first +address the resolver library returns for each host name will be used, +but the -A/--all flag will cause all of the addresses returned by the +resolver to be used. You need to give at least one of --ipv4 or --ipv6, +but both can be specified at the same time. + +Note that Nagios does not allow you to declare multiple addresses for +a host. To use this in a check_command for a host, you need to either +let %prog resolve addresses at runtime (thus depending on +DNS), or you need to generate a unique command declaration for each +host; something like: + + define host { + host_name smurf + address 198.51.100.23 + check_command check-host-alive::smurf + } + define command { + command_name check-host-alive::smurf + command_line $USER1$/check_ping_multiaddr -A46 -- 198.51.100.23 2001:db8:4711:17::1:23 + } """ __version__ = '<#VERSION#>' @@ -41,6 +66,7 @@ class Options(optparse.OptionParser): optparse.OptionParser.__init__( self, usage="%prog {-4|-6} [options] -- address ...", + formatter=trh_nagioslib.NoReflowHelpFormatter(), version=__version__, description=__doc__) self.add_option( -- GitLab