On Sun, Sep 09, 2007 at 09:37:16PM +1000, Rob Conway wrote:
> I was hoping someone could help me out in a script snippet (hopefully bash) 
> in how to extract data from an rrd to be used within script variables.
> 
> example... I would like to get four variables that represented say max daily, 
> min daily, avg daily and last value.  I do not want to plot a graph  just use 
> the rrd database to extract the four pieces of information and place them in 
> my script  variable so I can biuld a simple report  I already have the rrd's 
> setup for max, min avg


To help you get started (you will need to work this further out, correct it):

prepare a graph command:

rrdtool graph whatever DEF:... CDEF:... and so on.
Then:   PRINT:myvar:shellvar1=%lf  PRINT:myothervar:shellvar2=%lf
 and so on

Then in bash:

eval $(rrdtool graph whatever DEF:.... and so on)

or

eval $(/path/to/graph/script)


HTH
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/

_______________________________________________
rrd-users mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

Reply via email to