--- /usr/src/parselog-cgi-0.04/bin/parselog.cgi 2005-07-20 05:53:27.000000000 -0700
+++ parselog.cgi 2007-02-01 09:49:27.000000000 -0800
@@ -29,6 +29,7 @@
my $base = $ENV{SCRIPT_NAME} || '';
my $path = $ENV{PATH_INFO} || shift(@ARGV) || '';
$path =~ s/^\///g; # remove leading '/'
+debug::log("path $path") if(DEBUG);
my @paths = split('/', $path);
my $mpoint = join(' :: ', @paths);
@@ -221,6 +222,7 @@
my $i = 0;
my $j = 0;
+ my $step = $end->epoch() - $start->epoch();
my $stack = 'AREA';
my $dir = 0;
@@ -254,7 +256,7 @@
$color = $col;
}
}
- push(@args, add_target($e, $stack, $color));
+ push(@args, add_target($e, $stack, $color, $step));
$stack = 'STACK';
$j++;
}
@@ -267,7 +269,7 @@
$color = $col;
}
}
- push(@args, add_target($e, $stack, $color));
+ push(@args, add_target($e, $stack, $color, $step));
$j++;
}
@@ -313,11 +315,13 @@
my $rrd = shift;
my $stack = shift;
my $color = shift;
+ my $step = shift;
my $name = $rrd;
my @args;
my @srcs = (<_*>);
my $cdef = "CDEF:cdef$cdefid=0";
+ my $vdef = "VDEF:vdef$defid=";
foreach my $s (@srcs) {
if (-f "$s/$rrd") {
(my $state = $rrd) =~ s/\.rrd/\.state/;
@@ -331,11 +335,19 @@
}
push(@args, "DEF:def$defid=$s/$rrd:hits:AVERAGE");
$cdef .= ",def$defid,+";
+ $vdef .= "def$defid,TOTAL";
+ $cdef .= ",UN,0,def$defid,$step,*,IF";
$defid++;
}
}
- push(@args, $cdef, "$stack:cdef$cdefid#$color:$name");
- debug::log("Added $name") if(DEBUG);
+
+ push(@args,
+ $cdef,
+ $vdef,
+ "$stack:cdef$cdefid#$color:$name",
+ "GPRINT:vdef$cdefid:Total\:%5.1lf msgs"
+ );
+ debug::log("Added @args") if(DEBUG);
$cdefid++;
return @args;
+++ parselog.cgi 2007-02-01 09:49:27.000000000 -0800
@@ -29,6 +29,7 @@
my $base = $ENV{SCRIPT_NAME} || '';
my $path = $ENV{PATH_INFO} || shift(@ARGV) || '';
$path =~ s/^\///g; # remove leading '/'
+debug::log("path $path") if(DEBUG);
my @paths = split('/', $path);
my $mpoint = join(' :: ', @paths);
@@ -221,6 +222,7 @@
my $i = 0;
my $j = 0;
+ my $step = $end->epoch() - $start->epoch();
my $stack = 'AREA';
my $dir = 0;
@@ -254,7 +256,7 @@
$color = $col;
}
}
- push(@args, add_target($e, $stack, $color));
+ push(@args, add_target($e, $stack, $color, $step));
$stack = 'STACK';
$j++;
}
@@ -267,7 +269,7 @@
$color = $col;
}
}
- push(@args, add_target($e, $stack, $color));
+ push(@args, add_target($e, $stack, $color, $step));
$j++;
}
@@ -313,11 +315,13 @@
my $rrd = shift;
my $stack = shift;
my $color = shift;
+ my $step = shift;
my $name = $rrd;
my @args;
my @srcs = (<_*>);
my $cdef = "CDEF:cdef$cdefid=0";
+ my $vdef = "VDEF:vdef$defid=";
foreach my $s (@srcs) {
if (-f "$s/$rrd") {
(my $state = $rrd) =~ s/\.rrd/\.state/;
@@ -331,11 +335,19 @@
}
push(@args, "DEF:def$defid=$s/$rrd:hits:AVERAGE");
$cdef .= ",def$defid,+";
+ $vdef .= "def$defid,TOTAL";
+ $cdef .= ",UN,0,def$defid,$step,*,IF";
$defid++;
}
}
- push(@args, $cdef, "$stack:cdef$cdefid#$color:$name");
- debug::log("Added $name") if(DEBUG);
+
+ push(@args,
+ $cdef,
+ $vdef,
+ "$stack:cdef$cdefid#$color:$name",
+ "GPRINT:vdef$cdefid:Total\:%5.1lf msgs"
+ );
+ debug::log("Added @args") if(DEBUG);
$cdefid++;
return @args;