On Tue, Dec 13, 2005 at 04:53:21PM +0100, Hans Kinwel wrote:
> 
> I finally went to the bottom of this.  Not that it is rocket science.
> 
> When I do fping 1.2.3.4 I get
> 
> ICMP Host Unreachable from 194.178.10.133 for ICMP Echo sent to 1.2.3.4
> ICMP Host Unreachable from 194.178.10.133 for ICMP Echo sent to 1.2.3.4
> ICMP Host Unreachable from 194.178.10.133 for ICMP Echo sent to 1.2.3.4
> 1.2.3.4 is unreachable
> 
> In the (new, broken) fping.monitor I see:
> 
>    if (/^(\S+).*unreachable/i)
>    {
>        push (@unreachable, $1);
>    }
...
> It is evident now.  Some well intending person (probably Jim, from
> the RCSid) added a /i and now that string matches with the ICMP Host
> Unreachable", to which it is not supposed to match. It is supposed later
> to match with a "do nothing" clause that is indeed the right thing to do.
> 
> So if somebody would be so kind to remove that /i I will be much obliged.

I just got around to dealing with fping.monitor on my site.  I removed
the /i, got rid of my dumb idea to redirect stdout to /dev/null (it
loses the "address not found" error messages), and rearranged how
fping.monitor treats unidentified output, with this simple patch:

--- fping.monitor       2006/12/20 22:46:26     1.3
+++ fping.monitor       2006/12/20 23:07:36
@@ -63,6 +63,7 @@
        die "could not open pipe to fping: $!\n";
 
 my @unreachable;
+my @unidentified;
 my @alive;
 my @addr_not_found;
 my @slow;
@@ -122,7 +123,7 @@
 
     else
     {
-       print STDERR "unidentified output from fping: [$_]\n";
+       push @unidentified, $_;
     }
 }
 
@@ -216,6 +217,17 @@
     }
 }
 
+if (@unidentified != 0)
+{
+    print <<EOF;
+
+------------------------------------------------------------------------------
+unidentified output from fping
+------------------------------------------------------------------------------
+EOF
+       print join("\n", @unidentified), "\n";
+}
+
 #
 # traceroute
 #

_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to