[rrd-users] Re: Correct?
Jonathan Disher
jdisher at parad.net
Tue Apr 1 20:15:17 MEST 2003
This won't work. IIRC, RRDTool only stores numbers. The names will confuse
it. Let me suggest an alternative that will work better. I'll even give you
code I've written to help you.
Store your accounting information in a SQL database (my preference is MySQL,
but, it doesn't really matter). Retreive and generate your RRD graphs on
the fly based on what you're trying to represent visually.
What I use this system for right now is to generate bandwidth graphs, for a
number of targets (currently 20), dynamically based on when the graph should
start, and how many samples should be graphed. An example is
http://pasiphae.parad.net/cgi-bin/dograph.cgi?tablename=pasiphae&numsamples=
1440. This graphs the data transfer for the previous 1440 minutes (24
hours) for my machine's primary ethernet interface. This graph (and the RRD
database it comes from) is generated on the fly from values SELECT'd from
the MySQL table. The code makes some semi-intelligent decisions about how
long the averages are, but other than that, it's a straight "grab the data,
stick it in the RRD database, and kick out the graph" operation.
The code is available at http://pasiphae.parad.net/dograph.pl.txt. It might
be slightly confusing - I'm using Jeremy Zawodny's DBIx::DWIW
(http://search.cpan.org/search?dist=DBIx-DWIW) perl module to simplify DBI
calls to MySQL, rather than the standard DBD::MySQL driver. Try it, I
highly recommend it.
The way you would approach this is create an accounting table, with columns
for timestamp, userid, username, bytes used, and any other information you
might need. Populate the table (possibly with a perl script running every
so often from crontab), and modify my script to select only the records you
want, then kick out the graph.
-j
----- Original Message -----
From: "Chris Flanigan" <chris at whosyourdaddy.biz>
To: <rrd-users at list.ee.ethz.ch>
Sent: Tuesday, April 01, 2003 12:45 PM
Subject: [rrd-users] Re: Correct?
> Well, I'm actually wanting to plot lines (with the bytes at a given
> timestamp) for each username. Should I create a new rrd for each user,
> instead of compiling it all into one? This is my first attempt with
RRDTool,
> I'm just a bit confused still about how it all works, despite having read
> about it.
> I really appreciate your input.
>
> ----- Original Message -----
> From: "Ketan Patel" <k2pattu at yahoo.com>
> To: "Chris Flanigan" <chris at whosyourdaddy.biz>;
<rrd-users at list.ee.ethz.ch>
> Sent: Tuesday, April 01, 2003 11:34 AM
> Subject: [rrd-users] Re: Correct?
>
>
> > This seems correct since data types are gauges. But, why would you store
> username in a database this way? Database will have different/same
usernames
> as the case may be. But when you retrieve the data, I guess you will
> retrieve it based on the time and not username. If you plot a graph using
> those retrived unames, I can just imagine how the graph will look like.
> > cheers
> > k2
> > Chris Flanigan <chris at whosyourdaddy.biz> wrote:I have data that I'm
> wanting to graph and I'd like to get an ok, or
> > confirmation that my train of thought is correct. I'm new to RRDTool,
and
> > I've read all of the documents that I can get my hands on.
> >
> > rrdtool create example.rrd
> > DS:uid:GUAGE:U:U
> > DS:user:GUAGE:U:U
> > DS:bytes:GUAGE:U:U
> >
> > This will create a database where it will write the UID (user-id) value
as
> > it is given (it won't perform any delta calculations, etc, etc). It will
> > write the username as it is given (it will be text, not numerical). It
> will
> > also write the bytes used at a given time. It isn't meant to keep a
> running
> > tally, just x # of bytes at a given timestamp.
> >
> > Is my thinking here correct?
> >
> > --
> > Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
> > Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
> > Archive http://www.ee.ethz.ch/~slist/rrd-users
> > WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
> >
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> > Yahoo! Tax Center - File online, calculators, forms, and more
> >
> > --
> > Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
> > Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
> > Archive http://www.ee.ethz.ch/~slist/rrd-users
> > WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
> >
>
> --
> Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
> Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
> Archive http://www.ee.ethz.ch/~slist/rrd-users
> WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
>
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-users
mailing list