On Fri, 2003-01-24 at 09:54, Aled Treharne wrote:
> 
> > -----Original Message-----
> > From: Piero Calucci [mailto:[EMAIL PROTECTED]]
> > Sent: 24 January 2003 07:34
> > To: Aled Treharne
> > Subject: Re: downtime duration incorrect?
> > 
> [SNIP] 
> > I think "duration" refers to the time consumed by 
> > fping.monitor: so this
> > means it took 16 second to state that you host was actually down
> 
> Hi Piero.
> 
> Thanks for your message. I think the time you mentioned may be correct,
> however I'm not convinced that's what the downtime should be recorded
> as....
> 

in fact the "duration ..." message is output by fping.monitor

If you really need to know the downtime interval you should look at
log.d/downtime.log

there is a script I use to format it in a more homan-readable form, but
never put it in the public domain since is quite a pre-pre-pre-alpha... 

Maybe you are interested in playing with it and produce at least a 0.0.x
version...;-)

Piero

#!/usr/bin/perl
#
# Piero Calucci 2002
# ([EMAIL PROTECTED])
#
# [EMAIL PROTECTED] !!!

(@ARGV > 1) or open STDIN, 'downtime.log';

while (<>) {
	/^[ \t]*#.*/ and next;
	chomp;
	@l=split /[ \t]/;
	@t1=localtime($l[0]);
	@t2=localtime($l[3]);
	$t1[5]+=1900;  	$t2[5]+=1900;
	$t1[4]++ ; $t2[4]++ ;
	$l[0]=sprintf("%02d.%02d.%4d %2d:%02d:%02d",$t1[3],$t1[4],$t1[5],$t1[2],$t1[1],$t1[0]);
	$l[3]=sprintf("%02d.%02d.%4d %2d:%02d:%02d",$t2[3],$t2[4],$t2[5],$t2[2],$t2[1],$t2[0]);
	$up=shift @l ;
	$group=shift @l ;
	$service=shift @l ;
	$fail=shift @l ;
	$down=shift @l ;
	$interval=shift @l ;
	$details=join ' ',@l ;
	write;
}

format STDOUT =
@<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<< @<<<<<<< @<<<<
$up                $group           $service             $fail               $down    $interval
		    ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~
                    $details
                    ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~
                    $details
.

format STDOUT_TOP =

		DOWNTIME LOG
----------------------------------------------------------------------------------------------
time back up        group           service              1st failure         down     interval
                    (details)
----------------------------------------------------------------------------------------------
.
#!/usr/bin/perl
#
# Piero Calucci 2002
# ([EMAIL PROTECTED])
#
# [EMAIL PROTECTED] !!!

(@ARGV > 1) or open STDIN, 'history.log' ;

while (<>) {
	/^[ \t]*#.*/ and next;
	chomp;
	@a = split /\s+/ ;
	@t = localtime $a[3] ;
	$t[5]+=1900;
	$t[4]++ ;
	$a[3] = sprintf("%02d.%02d.%4d %2d:%02d:%02d",$t[3],$t[4],$t[5],$t[2],$t[1],$t[0]) ;
	$type = shift @a ;
	$group = shift @a ;
	$service = shift @a ;
	$time = shift @a ;
	$details = join ' ', @a ;
	write ;
}

format STDOUT =
@<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<
$type    $group          $service             $time
         ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~
	 $details
         ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~
	 $details
         ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~
	 $details
	 ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~
	 $details

.

format STDOUT_TOP =

         ALERT HISTORY
-----------------------------------------------------------------
type     group           service              time
         details
-----------------------------------------------------------------
.

Reply via email to