[rrd-users] Re: Fetching Data from an RRD

Chan Chi Hung chihung at mc-3.org
Fri Apr 30 04:53:18 MEST 2004


Try the following:

$ rrdtool graph /dev/null --start $starttime --end $endtime \
DEF:ds1=host1.rrd:ds1:AVERAGE PRINT:ds1:AVERAGE:%lf
0x0
2.613778

By not giving any graphing commands (LINE, AREA, STACK, ...), rrdtool 
will not generate any graphic files. Also, the PRINT will output the 
AVERAGE value that you want. Simply run the above and pipe it over awk 
to extract the value (rrdtool .... | awk 'NR==2{print}'


Rick Blundell wrote:
> Hi Guys,
> 
> I'm having trouble figuring out how to fetch data from an RRD from the
> command line. I understand graphing fine, basically what I want to do is
> fetch the average value in an RRD over a specified time period with a
> script. 
> 
> I can't find any good examples of RRD Fetch with either perl or shell
> scripting.  If someone can point me in the right direction that would be
> great.
> 
> Thank You,
> Rick Blundell
> 
> --
> 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
> 

-- 

CHAN CHI HUNG
Managed Computing Competency Centre
NTU, MPE, Block N3, #01c-10
50 Nanyang Avenue, Singapore 639798
Tel: +65 6790 4420 (O) Fax: +65 6316 0042
Email: chihung at mc-3.org   URL: www.mc-3.org

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