[rrd-users] rrd::fetch "How to sort datas"
Stefan Hotz
stefan.hotz at zurich.com
Mon Jan 21 12:59:04 MET 2002
Hello
I would like to sort the values from the data.rrd file. I can not figure
out how I have to access the datas in the sort function.
So far the values are printed out, but unfortunatley unsorted. How must I
write the sort function?
Second: Is it possible to pass the --start and --end argument to the fetch
function? I alwas get an error if I send these parameters as well to the
fetch function.
Thank's a lot in advance
Stefan
$file = "daten.rrd";
$arg = "AVERAGE" ;
# $arg = "AVERAGE --start 1011099600 --end 1011276042";
my ($start,$step,$names,$data) = RRDs::fetch ($file,$arg);
if ( $error = RRDs::error ) {
print "rrdtool fetch failed: \"$error\"\n";
exit 1;
}
print " ----------------------- sortiert ------------------";
@$data_sort = sort {$a <=> $b } @$data;
foreach my $sort (@$data_sort) {
foreach my $val (@$sort) {
printf "%12.1f", $val;
}
print "\n";
}
******************* PLEASE NOTE *******************
This message, along with any attachments, may be confidential or legally
privileged. It is intended only for the named person(s), who is/are the
only authorized recipients. If this message has reached you in error,
kindly destroy it without review and notify the sender immediately. Thank
you for your help.
**********************************************************
--
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