[mrtg] Applying a time offset to graphs
s.shipway at auckland.ac.nz
Sun Dec 14 04:42:24 CET 2008
I can think of several ways to achieve this. They all require you to be using RRDTool though.
First, you can load the data in using a script of your own, instead of MRTG. Keep a 'dummy' MRTG file around for the benefit of your web frontend, but dont run MRTG on it. Instead, write your script to obtain the data, and then store it into the RRD file with an explicit timestamp, 45 mins in the past. This will keep the data correct, and if you use the Routers2 frontend for MRTG/RRD you can set the 'uselastupdate' option in the routers2.conf so that the displayed graph will be based on the last update time rather than 'now'.
Second option is to write your own frontend or call to RRDTool to generate the graph. An RRDtool function exists to shift data by a number of seconds time-wise so this would correct the offset; of course you'd need ot be using something like rrd-cgi to generate the graph and the command line would be pretty huge.
Third, you could define your own timezone of 'now-45min' and use that for the Target. Since it would be displayed in the amended timezone this would effect a timeshift. A bit messy, though, even if you can control the local server's timezone files (you cant do this on Windows as they're compiled into the library)
We have a similar problem for our mail server throughput logs, although the delay is only 10min. We use the first method.
From: mrtg-bounces at lists.oetiker.ch [mrtg-bounces at lists.oetiker.ch] On Behalf Of John Doe [abussos at gmail.com]
Sent: Saturday, 13 December 2008 10:20 a.m.
To: mrtg at lists.oetiker.ch
Subject: [mrtg] Applying a time offset to graphs
I am relatively new to MRTG and I had a question that I did not see addressed in the documentation. I am monitoring a combination of Windows Server performance counters, which are updated immediately, and information retrieved from a database, which is not available until after a delay. As such, the "current" information being retrieved from the database sources is actually 45 minutes old. What I would like to do is to shift the x-axis of the graphs of information from the database by 45 minutes so that if I am comparing one of those graphs to a performance counter graph, the actual times at which events are displayed match up.
Any help would be appreciated. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mrtg