[rrd-users] Re: Examples / Docs...

Chris Knipe savage at savage.za.org
Sun Aug 11 01:33:28 MEST 2002


Ok,

I've read through what you all said, and I think I took quite allot of it to
heart.  I've also come up (on my own this time), with what I think I need,
and so far most of it is working properly....

My rrd database, consist of 5minute intervals for a 2yr period (3.5MB db).
I know this may be overkill, especially in regards to graphs, but it would
give me the benefit that I would have a set of data to graph for any period
during those two years, updated in 5 minute intervals, providing my clients
with a rather good representation of their data.

rrdtool create netsonic.tun0.rrd DS:input:COUNTER:300:U:U
DS:output:COUNTER:300:U:U RRA:AVERAGE:0.5:1:210240

Now, I have my script, polling SNMP, and updating the graphs every 5 minutes
via crontab, and from what I can see, this is also working properly.

rrdtool update netsonic.tun0.rrd N:$IN:$OUT

Then, I want to create graphs, showing the in/out traffic usage for the
interface, in a similar type of graph presented by MRTG.  I use rrdtool
graph in the following manner...

rrdtool graph tun0-day.gif \
  --start -86400 --vertical-label "KB/Sec Transferred"\
  DEF:input=netsonic.tun0.rrd:input:AVERAGE \
  DEF:output=netsonic.tun0.rrd:output:AVERAGE \
  AREA:input#00FF00:"In traffic" \
  LINE1:output#0000FF:"Out traffic"

>From what I can see from the +-90 minutes of data I have so far, this seems
to do the job properly. I can change / alter the combination of --start
and --end in the above graph to draw the graph for any duration of time
during the two year period (from what I understand).  Should RRD not have
data for the time specified, it would simply draw the graph without any data
on it - suits me fine.

My second last requirement, is that I want to have a graphical
representation of the total incoming traffic over the interface for the
current month.  I've tried something like this:

rrdtool graph tun0-total.gif \
  --start `date -v1d -v0H -v0M -v0S +%s` --vertical-label "Traffic
Transferred" \
  DEF:input=netsonic.tun0.rrd:input:AVERAGE \
  "CDEF:mb=input,3600,*" \
  CDEF:free=mb,500,GT,mb,0,IF \
  CDEF:pay=mb,500,GT,0,mb,IF \
  AREA:free#00FF00:"Free Incoming Traffic" \
  AREA:pay#FF0000:"Charged Traffic"

The graph time, starts at the first second of the *current* month, as
specified at date -v1d -v0H -v0M -v0S +%s.  Anything under 500MB, I want in
a green area, and the moment the total incoming traffic exceeds 500MB, I
want it to switch to a new area, and graph it on a red area.

However, currently, it seems like the graph is flatlining at approximately
9MB, not wanting to go up any further.  What's wrong with this graph that
I've attempted to correct?

The last question I have, is how can I extract the data from --start time
to --end time in a CSV type format?, and how can I get the "Current Speed"
as they are normally shown on MRTG's HTML pages....

Once again, thank you for everyone helping - I really do appreciate it
allot, and it is helping me big time to understand RRD allot better...

--
me


----- Original Message -----
From: "Alex van den Bogaerdt" <alex at ergens.op.HET.NET>
To: "Chris Knipe" <savage at savage.za.org>
Cc: "RRD users" <rrd-users at list.ee.ethz.ch>
Sent: Saturday, August 10, 2002 11:29 PM
Subject: [rrd-users] Re: Examples / Docs...


>
> Chris Knipe wrote:
>
> > rrdtool create myrouter.rrd         \
> >             DS:input:COUNTER:600:U:U   \
> >             DS:output:COUNTER:600:U:U  \
> >             RRA:AVERAGE:0.5:1:600      \
> >             RRA:AVERAGE:0.5:6:700      \
> >             RRA:AVERAGE:0.5:24:775     \
> >             RRA:AVERAGE:0.5:288:797    \
> >             RRA:MAX:0.5:1:600          \
> >             RRA:MAX:0.5:6:700          \
> >             RRA:MAX:0.5:24:775         \
> >             RRA:MAX:0.5:288:797
> >
> > This is from the RRD tutorial, and has 600 samples of 5 minutes, 700 of
> > 30minutes, 775 of 2hours and 797 of 1day.
> >
> > Now, to my understanding, I'd need to modify that, so that I have 228
> > samples of 5 minutes (the last 24hrs),  1488 samples of 30 minutes (the
last
> > 31 days, or month), and 365 samples of 1 day (the last year).
>
> You need nothing.  If you use these (or any other) values it is because
> you want to.
>
> What do you want?  You want to be able to query data in resolution 'r'
> and for a timespan 't'.  You can do this only if you have data available
> for timespan 't' *or*more*.  The resolution is not as important but it
> helps RRDtool to quickly do its job. More on this later.
>
>
> > This leaves me with a few questions...
> > Firstly, I presume because my longest period is 365 1 day periods, that
this
> > database will only hold the information for 1 year.  If I wanted to
archive
> > it for the last two years, do I simply add another RRA with 730 samples
of
> > 1day?  And how will this affect the graph?
>
>
> I don't see why you want to do that.  If you have an RRA with 730 rows,
> you can fetch 365 of them, can't you?
>
> What you can't do by the way is plot january 1st 2000 upto and including
> december 31st 2001 with only 730 rows.  You need 731 rows (feb 29th !)
>
>
> > Thirdly, why can't I simply use 210240 samples of 5 minutes (two years)
and
> > use 1 RRA?
>
> You can.  RRDtool will have to do a lot of calculations at graph time
> in stead of collection time.
>
> HTH
> --
>    __________________________________________________________________
>  / 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: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