Steven F Siirila writes:
> 
> Bug Report:
> If fping.monitor parses an unrecognized line from fping, it writes that
> line to stderr BEFORE writing anything else to stderr/stdout.  This causes
> the resulting error message to appear in the summary line instead of the
> sorted list of hosts appearing there.

Do you have the patch I posted a while ago for fping.monitor?  It adds
code to separate hosts and details the way most monitors do.  I see
that I didn't fix the STDERR problem though.  Try applying my patch
and then making this additional change:


delete the line:
        print STDERR "unidentified output from fping: [$_]\n";

and replace with:
        $details{"unknown"}= $_;
        push @unreachable, "unknown";

Which should print all unknown messages at the end, with the fake
hostname "unknown".  If this isn't sufficient, please post the messages
you're getting.

        -- Ed

--------------------
--- 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