--- flow2rrd.pl 2004/12/27 15:58:23 1.13
+++ flow2rrd.pl 2004/12/27 16:11:47 1.14
@@ -33,6 +33,7 @@
use POSIX; # from OpenPKG "perl"
use IO::File; # from OpenPKG "perl"
use Getopt::Long; # from OpenPKG "perl"
+use Time::Local; # from OpenPKG "perl"
use File::Temp; # from OpenPKG "perl"
use Data::Dumper; # from OpenPKG "perl"
use Date::Parse; # from OpenPKG "perl-time"
@@ -568,11 +569,13 @@
}
my @draw = (@draw_o, 'COMMENT:\n', @draw_i);
push(@draw, "HRULE:0#000000");
+ my $now = time();
+ my $tzoffset = $now - timelocal(gmtime($now));
my $ts = int(($graph->{-graph_start} / (24*60*60)) + 0) * (24*60*60);
my $te = int(($graph->{-graph_end} / (24*60*60)) + 1) * (24*60*60);
for (my $t = $ts; $t < $te; $t += (12*60*60)) {
- if (($t % (24*60*60)) == 0) { push(@draw, "VRULE:$t#000000"); }
- else { push(@draw, "VRULE:$t#999999"); }
+ if (($t % (24*60*60)) == 0) { push(@draw, sprintf("VRULE:%d#000000", $t - $tzoffset)); }
+ else { push(@draw, sprintf("VRULE:%d#999999", $t - $tzoffset)); }
}
my @args = ();
push(@args, $graph->{-img_file});
@@ -654,11 +657,13 @@
}
my @draw = (@draw_o, 'COMMENT:\n', @draw_i);
push(@draw, "HRULE:0#000000");
+ my $now = time();
+ my $tzoffset = $now - timelocal(gmtime($now));
my $ts = int(($graph->{-graph_start} / (24*60*60)) + 0) * (24*60*60);
my $te = int(($graph->{-graph_end} / (24*60*60)) + 1) * (24*60*60);
for (my $t = $ts; $t < $te; $t += (12*60*60)) {
- if (($t % (24*60*60)) == 0) { push(@draw, "VRULE:$t#000000"); }
- else { push(@draw, "VRULE:$t#999999"); }
+ if (($t % (24*60*60)) == 0) { push(@draw, sprintf("VRULE:%d#000000", $t - $tzoffset)); }
+ else { push(@draw, sprintf("VRULE:%d#999999", $t - $tzoffset)); }
}
my @args = ();
push(@args, $graph->{-img_file});
|