[rrd-users] Re: rrdfetch ?

Clifton Royston cliftonr at lava.net
Thu Aug 30 20:15:41 MEST 2001


On Thu, Aug 30, 2001 at 10:05:08AM -0400, Daniel R . Kilbourne wrote:
> 
> So, I am trying to understand the rrdfetch option a little better to
> do some reporting the "higher ups" want. Basically, they want a web
> page that has just text reading the AVERAGE, MIN and MAX for several
> things I am monitoring with mrtg/rrdtool daily, weekly, monthly and
> yearly.
> 
> Any ideas/suggestions/flames about how I can go about getting that
> info?
> 
> I have done something similar to report high usage on modems. I
> basically do this:
> 
> /usr/local/bin/rrdtool fetch /path.to.specified/rrd MAX | cut -f4 -d /' ' | grep + | sort -te +1 | tail -1
> 
> This seems to show the MAX just right, but I need AVERAGE and MIN
> too.....I may be braindead today (no caffeine yet), but I cannot seem
> to wrap my brain around it...

Speaking of "wrapping", it would be nice to set your lines to wrap in
your mailer, if you wouldn't mind.

Anyway - there is a pretty standard way to do this with RRDtool, it is
just a little counter-intuitive - you use rrdgraph instead.

If you use rrdgraph, besides the graphing capabilities, it's got the
ability to define variables based on DSes, a builtin RPN calculator,
and the ability to print the formatted results of those calcuations to
standard out (within Perl, it comes out as the return value from the
function call.)  This makes it easy to write an RRDgraph line that does
the calculations you want, discard the graph, and use the value it
returns.  Like I said, counterintuitive, but it works great.  This is
what Cricket (at least) uses to get its totals from RRD files for
display, and I think the new MRTG does the same.

You should view rrdfetch as being used only for fetching raw data, if
you are going to write your own routines for calculating on it.  (E.g.
computing cumulative totals for some time range by multiplying time
interval x average rate for the resolution you want.)

Hope this helps!

  -- Clifton

-- 
 Clifton Royston  --  LavaNet Systems Architect --  cliftonr at lava.net
   WWJD?   "JWRTFM!" - Scott Dorsey (kludge)   "JWG" - Eddie Aikau

--
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