[mrtg] Re: automatique concatenation

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Mon Nov 19 13:18:27 MET 2001

=?iso-8859-1?q?sylvain=20maugiron?= wrote:

> I had my mrtg "well configured" until somebody (f*** him!!) moved my
> log files.

<g> Not as bad as a coworker deleting the file "/unix" as it wasn't
written to since 1993 :)

> I've try to cat oldmrtg.log >> newmrtg.log, but it doesn"t work.
> I've try to modify the newmrtg.log i've just created to keep the
> chronology, but I haven't succeded.

MRTG will have created new log files as it couldn't find them anymore.

- Make a backup of both files
- Run MRTG on both the old an the new log files (if possible do this
  simultaniously).  This will sync the time stamps in both log files
  (time stamps are the first value on each line)
- Stop MRTG (don't forget your schedular), this to make sure the files
  do not change while you process them

At a certain point in time "somebody" moved the files.  The new log
files will show values from that moment on (start of log file upto
a certain line) while the old log file received no input.

After synchronizing the files (step 2) the old log file will have
been updated with a flat rate (maybe zero) for the missing time.

You have to find the corresponding line in both log files and create
new log files from the start of the new file and the end of the old

Let's talk about the following files:
"old": the log file that has been moved
"new": the log file that was automatically created
"tmp": the file you build

The problem occured one day ago, this will show up somewhere around
line 300 in both "old" and "new".  This isn't hard to find because
the "new" file has only zeros thereafter while the "old" file looks
odd from the start of the file upto that line.

Make sure you use the appropriate line number, do not follow my example
to the letter !!!

- Copy the first 300 lines from "old" into "tmp".
- Delete the first 300 lines from "old".
- Append "old" to "tmp".
- Move "new" away and rename "tmp" to "new"

Of course, any procedure with the same result as this will do.

Now you should be able to restart MRTG.  There is a good chance that you
will see a small problem at the moment where the move occured however most
data will be OK.

 / 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