[rrd-users] Problem fetching last value

Bjørn Nordbø bn at nextra.com
Fri Jul 7 10:53:54 MEST 2000


As I mentioned some time ago, I am working with a CGI-script that
provides the neccesary elements to make a MRTG-lookalike page from
an RRD-archive. For the summary information, I need a the last value
stored in the database.

Currently, I do this by adding a an RRA to the RRD-archive:

RRA:LAST:0.5:1:1

An then fetch the last, or "Current", value:

$ra_values = (RRDs::fetch($rrd, 'LAST', '-s', '-1s', '-e', 'now'))[3];

Now, $ra_values shoul contain an array of the values fetched. I
would have beleived this to be only one value, as the RRA should
only contain one, and the should not be many values stored from
'one second ago' to 'now', still $ra_values will contain to arrays,
one with data and one empty.

Anyway, this seems to work fine, except that from time to time,
$ra_values will contain only empty values, and I get some "use
of uninitialized value" warnings on stderr.

Have I misunderstood the use of LAST RRA's or RRDs::fetch()? What
is the Right[tm] way to fetch the last value in an RRD?

I hope this wasn't to confusing; I have to admit that there are
things about rrdtool that I still do not fully grasp...


Best regards,
              Bjørn Nordbø

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