This patch appears to cover the case I ran into, which was:

Subject: ALERT foo.com/ping: unidentified output from fping: [ICMP Time Exceeded from 
192.168.1.1 for ICMP Echo sent to foo.com (192.168.1.1)] (Wed Feb 20 19:28:13)

Summary output        : unidentified output from fping: [ICMP Time Exceeded
from 152.63.72.81 for ICMP Echo sent to cityofeagan.com (156.142.111.4)]

Group                 : foo.com
Service               : ping
Time noticed          : Wed Feb 20 19:28:13 2002
Secs until next alert : 
Members               : foo.com

Detailed text (if any) follows:
-------------------------------
unidentified output from fping: [ICMP Time Exceeded from 192.168.1.2 for ICMP Echo 
sent to foo.com (192.168.1.1)]
unidentified output from fping: [ICMP Time Exceeded from 192.168.1.2 for ICMP Echo 
sent to foo.com (192.168.1.1)]
foo.com

start time: Wed Feb 20 19:27:09 2002
end time  : Wed Feb 20 19:27:11 2002
duration  : 2 seconds

------------------------------------------------------------------------------
unreachable hosts
------------------------------------------------------------------------------
foo.com


On Thu, Feb 21, 2002 at 03:45:03PM -0500, Ed Ravin wrote:
> 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};
> +     }
>  }
>  
>  

-- 

Steven F. Siirila                       Office: Lind Hall, Room 130B
Internet Services                       E-mail: [EMAIL PROTECTED]
Office of Information Technology        Voice: (612) 626-0244
University of Minnesota                 Fax: (612) 626-7593

Reply via email to