[rrd-developers] Re: Holt - Winter Q .. detecting a failure from a command line
Jake Brutlag
jakeb at microsoft.com
Wed Dec 17 02:04:05 MET 2003
rrd-developers-bounce at list.ee.ethz.ch wrote:
> ie.. my script does something like this
> rrdtool update foobar.rrd N:value
>
> and I would like to do something like
>
> rrdtool update foobar.rrd N:value
> if (??? == 'aberrant' ) {
> do something
> }
> hopefully the '???' wouldn't be too expensive an operation, so I
> could do it every update.
Update only stores data in RRAs. Retrieval of data from RRAs (including
the aberrant behavior RRAs) can done through fetch. However, as you
note, this may not be that efficient. That is the motivation behind the
updatev interface. It works like update, except it returns data on any
RRAs updated (including the values stored).
Unfortunately, updatev isn't exposed via the C interface (see rrd.h).
This is because it uses the same structure to return data as rrd_info
(which you will note also doesn't appear in rrd.h). If someone with the
right expertise on this list can tackle a C interface for rrd_info, I am
fairly certain the same solution can be utilized for updatev.
I did extend the perl interface for updatev. The return value is a hash
reference, exactly like info:
$hashref = RRDs::updatev ("myfile.rrd","957214600:4148:3363");
$ERR=RRDs::error;
die "ERROR updating cookies.rrd: $ERR\n" if $ERR;
foreach my $key (keys %$hashref) {
print "$key = $$hashref{$key}\n";
}
Jake Brutlag
Network Analyst
Microsoft MSN
--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-developers
mailing list