[mrtg] Re: SV: Re: inserting log in database
Ron Koperdraad
r.m.koperdraad at wanadoo.nl
Fri Nov 1 00:59:45 MET 2002
Hi,
I think you have to write a perl script, reading the log files shouldn't be
a problem.
You have to use the perl DBI modules to insert it into you database.
You can download the source at:
http://sunsite.computing.dcu.ie/pub/perl/modules/by-authors/id/TIMB/
The site http://dbi.perl.org/ will give you additional info
I hope it will help you to solve you problem.
RK
----- Original Message -----
From: "Christian Rasmussen" <chr at egebjerg.com>
To: <mrtg at list.ee.ethz.ch>
Sent: Thursday, 31 October, 2002 22:54
Subject: [mrtg] SV: Re: inserting log in database
>
> Hi Paul,
>
>
> I just looked at your script again, I know see that the meaning of your
> script must be to read the MRTG logfiles and insert the data in mysql.
>
> What I would have liked to do was to insert some lines in the MRTG perl
> script to grab the data from there. No one has any idea in what area of
the
> code the log is written??
>
> If I instead read the logfiles I will write it in PHP, but your shell
script
> is still very interesting :)
>
> Best regards,
> Christian Rasmussen
>
>
> > > Where do you get the data in "%.0f,%.0f,%.0f,%.0f,%.0f,%.0f" from?
> >
> > That's merely formatting for the numbers supplied in the printf line in
> > the awk script. "%.0f" means "a floating point number with zero decimal
> > places". Most awk implementations will also let you use a "%i" to
> > indicate an integer, but that's doesn't work everywhere, and %f does.
>
> --
> 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
>
>
--
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