[mrtg] Re: Changing graph time
mpetach at eng.concentric.net
mpetach at eng.concentric.net
Tue Sep 12 14:58:23 MEST 2000
Recently, Chris Koester talked about "[mrtg] Changing graph time", and said
> I have been looking briefly to see if there is a way
> to show only 24 hour peroid verus 36 hours on the
> daily graph. Does anyone know how how to get this to
> show only the 24 hours.
> Thanks in advance for the help.....
> Chris
Hi Chris,
It should be possible by adjusting the maxX parameter to rateup;
I'm successfully graphing two-year wide graphs by adjusting that
parameter on the yearly scale with the following code snippet on
our graphing boxes (NB this is written for MRTG 2.7.5)
# generate BIG gifs for long history...
#
foreach my $interval (@intervals) {
my ($bigmaxx) = 600; my ($bigmaxy) = 100;
$bigmaxx = 720 if ($interval eq "year");
my ($lastrun) = `/bin/head -1 $statdest`;
$lastrun =~ s/^(\d+).*\s*$/$1/;
my ($maxv) = $unscaled * $maxspeed;
my ($command) =
"$rateup $destdir $id $lastrun $colormap $kMG $ylegend " .
"$peak{$interval} $id-$interval-big.gif " .
"$maxv $maxv $bigmaxx $bigmaxy $xscale $yscale $growright $step{$interval}
$bits
";
print "Running command: \"$command\"...\n" if $DEBUG;
if (! open PIPE, "$command|") {
print "...!!!ERROR!!! execution of \"$command\" failed\n";
exit(-1);
}
...etc...
Normally the maxX parameter is set to 400 for the default time
ranges that MRTG graphs. I've only experimented on lengthening
the time scale, but theoretically, if you change it from 400
down to 270, you should get what you're looking for. I'm not
near a computer I can test this right now, but I'd be glad to
test it later this week and report the results back.
Hope this helps!
Matt
--
Concentric Network, a Nextlink Corp. | Matthew Petach {MP59}
Senior Network Architect | mpetach at concentric.net
1400 Parkmoor Avenue | Tel: (408) 817-2535
San Jose, CA 95126-3429 | Fax: (408) 817-2630
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list