[mrtg] Re: using mrtg with data stored in mysql

Steve Shipway s.shipway at auckland.ac.nz
Sun Dec 12 22:46:13 MET 2004

>I log data for bandwidth usage and billing to a mymql database 
>on a 5 minute basis for up to 7 days then a 2 hour basis for 
>30 days then a 1 day basis for the rest of the year.
>Now I want to graph this material but it seems that mrtg only 
>likes to work with one new set of figures and assumes they are 
>from the current time and wont let me feed it numbers going 
>back several months.
If you use MRTG with the RRDTool backend, then you can insert data into the
RRDTool database at any timepoint, not just the current time.  See the
rrdtool update manual page.  So, you could probably write a simple script to
extract your historical data and then repeatedly call rrdtool to insert it
at the appropriate point.

However, I'm not quite sure how it will react to data being inserted past
the reach of the standard RRAs.  It's possible that it will not be able to
correctly summarise -- remember that MRTG/RRD store the summarised data, not
the detailed data.

You may find it is easier to just take your stored data, and build an RRD
from scratch by inserting the correct summary data directly -- either
through the Perl interface or by writing an XML file and importing it.  For
an example of this (in Perl), see the ternd.cgi trending module shipped with



Steve Shipway: ITSS, University of Auckland
Email: s.shipway at auckland.ac.nz  Web: http://www.steveshipway.org/  
** We can only discover new oceans when we have the **
** courage to lose sight of the shore.              **

-- Attached file removed by Ecartis and put at URL below --
-- Type: text/x-vcard
-- Size: 155 bytes
-- URL : http://www.ee.ethz.ch/~slist/p/58-Steve%20Shipway.vcf

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