From 73fcf8782bfce97771f0c0f85597c41231cee526 Mon Sep 17 00:00:00 2001 From: Klaus Sperner Date: Fri, 17 Sep 2021 17:22:02 +0200 Subject: [PATCH] improvements for tcp_reachability - update documentation "See Also" - unify error messages - check max_time for validity --- plugins/network/tcp_reachability | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/network/tcp_reachability b/plugins/network/tcp_reachability index f35b1a5c..5aba3fe9 100755 --- a/plugins/network/tcp_reachability +++ b/plugins/network/tcp_reachability @@ -108,9 +108,10 @@ timeout There are a couple of ping plugins in L. Many -of these require additional software to be installed. The plugin +of these perform ICMP pings. The plugin L -provides timing statistics similar to this plugin. +tests TCP ports and provides timing statistics similar to this plugin, but it +does not provide a reachability graph and it does not define any alarm limits. =head1 AUTHOR @@ -199,11 +200,16 @@ short_label=${short_label:-"false"} for target in $targets; do if [[ ! "$target" =~ $host_port_regex ]]; then - >&2 echo "Invalid configuration: target $target is not a valid 'host/port' combination" + >&2 echo "Invalid configuration: target $target is not a valid 'host/port' combination. Aborting." exit 1 fi done +if [[ ! "$max_time" =~ ^[0-9]+$ ]]; then + >&2 echo "Invalid configuration: max_time $max_time must contain only digits. Aborting." + exit 1 +fi + if [[ "$1" == "config" ]]; then echo 'multigraph tcp_reachability' echo 'graph_args --base 1000 --lower-limit -0.25 --upper-limit 1.25 --rigid'