The fping.monitor in mon-0.99.2 doesn't know how to parse fping's
output when it gets an ICMP destination unreachable message.  A
simple patch for the problem is below.  My fping version is 2.2b1.


--- fping.monitor       2001/10/12 04:37:52     1.1
+++ fping.monitor       2001/10/12 04:39:13
@@ -53,6 +53,7 @@
 my $CMD = "fping -e -r $RETRIES -t $TIMEOUT";
 my $START_TIME = time;
 my $END_TIME;
+my %details;
 
 exit 0 if (@ARGV == 0);
 
@@ -91,6 +92,16 @@
        push @unreachable, $1;
     }
 
+# ICMP Host Unreachable from 1.2.3.4 for ICMP Echo sent to 2.4.6.8
+
+       elsif (/^ICMP (.*) for ICMP Echo sent to (\S+)/)
+       {
+               if (! exists $details{$2})
+               {
+                       $details{$2}= $_;
+               }
+       }
+
     else
     {
        print STDERR "unidentified output from fping: [$_]\n";
@@ -149,6 +160,11 @@
     }
 
     print "\n";
+
+       foreach my $ipnum (@unreachable)
+       {
+               print $ipnum, " : ", $details{$ipnum}, "\n" if exists $details{$ipnum};
+       }
 }
 
 

Reply via email to