<br><font size=2 face="Arial">Great Alex,</font>
<br>
<br><font size=2 face="Arial">It was almost as simple as I thought.</font>
<br>
<br><font size=2 face="Arial">For the record, I modified function "log2rrd"
in file MRTG_lib.pm as follow:</font>
<br>
<br><tt><font size=2>sub log2rrd ($$$) {</font></tt>
<br><tt><font size=2> ...</font></tt>
<br><tt><font size=2> my %next;</font></tt>
<br><tt><font size=2> my $rrd;</font></tt>
<br><tt><font size=2># CBU 2008.07.09: Change the way MRTG l.log files
are converted into RRD databases</font></tt>
<br><tt><font size=2># my @steps = qw(300 1800 7200 86400);</font></tt>
<br><tt><font size=2># my %sizes = ( 300 => 600, 1800 =>
700, 7200 => 775, 86400 => 797);</font></tt>
<br><tt><font size=2> my @steps = qw(300 900 3600);</font></tt>
<br><tt><font size=2> my %sizes = ( 300 => 8640, 900 =>
35040, 3600 => 43800);</font></tt>
<br><tt><font size=2> open R, "<$$cfg{logdir}$$rcfg{'directory'}{$router}$router.log"
or</font></tt>
<br><tt><font size=2> die "ERROR: opening
$$cfg{logdir}$$rcfg{'directory'}{$router}$router.log: $!";</font></tt>
<br><tt><font size=2> debug('rrd',"converting $$cfg{logdir}$$rcfg{'directory'}{$router}$router.log");</font></tt>
<br><tt><font size=2>...</font></tt>
<br><tt><font size=2> </ds></font></tt>
<br><tt><font size=2>RRD $first_step{300} = 0; # invalidate</font></tt>
<br><tt><font size=2># CBU 2008.07.09: Change the way MRTG l.log files
are converted into RRD databases</font></tt>
<br><tt><font size=2> addarch(1,'AVERAGE','in','out',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2> addarch(3,'AVERAGE','in','out',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2> addarch(12,'AVERAGE','in','out',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2> addarch(1,'MAX','maxin','maxout',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2> addarch(3,'MAX','maxin','maxout',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2> addarch(12,'MAX','maxin','maxout',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2># addarch(1,'AVERAGE','in','out',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2># addarch(6,'AVERAGE','in','out',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2># addarch(24,'AVERAGE','in','out',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2># addarch(288,'AVERAGE','in','out',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2># addarch(6,'MAX','maxin','maxout',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2># addarch(24,'MAX','maxin','maxout',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2># addarch(288,'MAX','maxin','maxout',\%store,\%first_step,\$rrd);</font></tt>
<br><tt><font size=2> $rrd .= <<RRD;</font></tt>
<br><tt><font size=2></rrd></font></tt>
<br><tt><font size=2>RRD</font></tt>
<br>
<br><tt><font size=2> if ( $OS eq 'NT' ) {</font></tt>
<br><tt><font size=2> open (R, "|$$cfg{rrdtool}
restore - $$cfg{logdir}$$rcfg{'directory'}{$router}$router.rrd");</font></tt>
<br><tt><font size=2>...</font></tt>
<br><tt><font size=2>}</font></tt>
<br>
<br><font size=2 face="Arial">Now, I have one additionnal question: </font>
<br>
<br><font size=2 face="Arial">For a few months, we are also collecting
data from these sensors via another monitoring system using rrdtools.</font>
<br>
<br><font size=2 face="Arial">So, I would like to import data from this
other monitoring system into the .RRD that I will generate from MRTG (ie:
using "rrdtools update"). </font>
<br>
<br><font size=2 face="Arial">But, since there will already be some data,
I'm wondering what will be the behaviour of rrdtools in this case (ie:
when one inserts values at times when there are already data). </font>
<br>
<br><font size=2 face="Arial">Can you enlighten me?</font>
<br>
<br><font size=2 face="Arial">Best regards,</font>
<br>
<br><font size=2 face="Arial">Cyrille</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Cyrille Bollu <Cyrille.Bollu@fedasil.be></b>
</font>
<br><font size=1 face="sans-serif">Envoyé par : rrd-users-bounces@lists.oetiker.ch</font>
<p><font size=1 face="sans-serif">09/07/2008 10:32</font>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">A</font></div>
<td valign=top><font size=1 face="sans-serif">Alex van den Bogaerdt <alex@ergens.op.het.net></font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top><font size=1 face="sans-serif">rrd-users@lists.oetiker.ch,
rrd-users-bounces@lists.oetiker.ch</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td valign=top><font size=1 face="sans-serif">Re: [rrd-users] Tips and
thoughts on how to optimally import data points
from MRTG .log files into new RRD databases</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2><br>
rrd-users-bounces@lists.oetiker.ch wrote on 09/07/2008 02:25:35:<br>
<br>
> > I know that I can convert my MRTG .log file to RRD databases
by adding the <br>
> > "LogFormat: rrdtool" line in MRTG's configuration files.
However, the RRA <br>
> > generated by doing this don't satisfy me.<br>
> <br>
> I don't remember when/where/what, but I'm almost 100% sure I've seen<br>
> a solution for this. Try google.<br>
></font></tt><font size=3> <br>
</font><tt><font size=2><br>
I'm pretty sure also but you already gave me a very good tip hereunder
:-)</font></tt><font size=3> <br>
</font><tt><font size=2><br>
> <br>
> <br>
> I suggest looking in MRTG or RateUp, find the part where it creates
the<br>
> new database and modify that part.<br>
> </font></tt><font size=3><br>
</font><tt><font size=2><br>
Great! I didn't realized MRTG was written in Perl. </font></tt><font size=3><br>
</font><tt><font size=2><br>
Actually, I think I'll have to modify function "log2rrd" in file
MRTG_lib.pm:</font></tt><font size=3> <br>
</font><tt><font size=2><br>
sub log2rrd ($$$) {</font></tt><font size=3>
</font><tt><font size=2><br>
...</font></tt><font size=3>
</font><tt><font size=2><br>
my @steps = qw(300 1800 7200
86400);</font></tt><font size=3> </font><tt><font size=2><br>
my %sizes = ( 300 => 600,
1800 => 700, 7200 => 775, 86400 => 797);</font></tt><font size=3>
</font><tt><font size=2><br>
...</font></tt><font size=3>
<br>
</font><tt><font size=2><br>
Am I dreaming? Could it be so simple? :-)</font></tt><font size=3> <br>
</font><tt><font size=2><br>
Thanks Alex</font></tt><font size=3> <br>
</font><tt><font size=2><br>
Cyrille_______________________________________________<br>
rrd-users mailing list<br>
rrd-users@lists.oetiker.ch<br>
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users<br>
</font></tt>
<br>