[mrtg] Re: Adding old log files to RRds

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sat Dec 8 00:57:01 MET 2001


Trent Melcher wrote:

> I have been running MRTG with RRDtool for about 3 months.  I never converted
> my old log files over.  So my data only goes back 3 months.  Is there anyway
> to incorporate the old log files back into the current rrds to get an entire
> year graphed????

Difficult but not impossible.

- make sure you have a backup of every file involved
- make sure you know when to use this backup
- collect information
  - properties of the rrd file
  - last entry of the mrtg log file (this is the oldest entry)
  - cutoff point to use (where does your rrd file contain information)
  - last update time of the rrd file
- stop the updating

Choose either these four steps ...

- create a new rrd file that has the same layout as your current one
  but make sure to use a start time *before* the last mrtg entry
- modify some of the properties
  - counter type GAUGE
  - heartbeat value 1000000
- process the mrtg log file, reverse order (so: last line first)
  - read [time] [in] [out] [maxin] [maxout] from mrtg log
  - update rrd [time]:[in]:[out]
- change the properties of the rrd file back to their original

... or this single one:
(this assumes your current rrd file is in mrtg compatible format)

- let MRTG generate a new rrd file by setting the "Logformat: rrdtool"
  option and running mrtg once.

Then do:
- update both rrd files once.  Use the same time stamp and the same data
- dump both rrd files to xml 
- merge the original file and the temporary file
- restore the merged file to rrd format

Exact details of the process are left out on purpose, you want to
know *exactly* what you're doing.  

HTH
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
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