From: manuel a. <al...@gm...> - 2011-02-28 22:56:31
|
On 28/02/11 14:47, Steve Schnepp wrote: > On Mon, Feb 28, 2011 at 14:26, manuel aldana <al...@gm... > <mailto:al...@gm...>> wrote: > > I am sure natively this can be done with RRD (simply extract last days > value and compare) > > > Actually, I'm quite curious about how to do this with only CDEF in RRD. > I don't think you can retrieve values at arbitrary time, only the > previous computed one via PREV like described in [1]. > And therefore you cannot have a timeshifted RRD. > > I'm afraid then that you have to take care of your plugin history in > the plugin. > > [1] http://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.html > > -- > Steve Schnepp > http://blog.pwkf.org/ Yes, it seems not to be possible with CDEF, but fetch would do it (hour interval): === rrdtool fetch file.rrd AVERAGE -r 3600 The doing some scripting (with awk, bash, python etc.) and then parameters is stdout last and 24th-last line. But I wonder whether it is possible to access the rrd file by variable inside the plugin script... Doing hardcode filepath would be very fragile. -- manuel aldana al...@gm... software-engineering blog: http://www.aldana-online.de |