[rrd-users] Re: fetching MAX values for a timeslice
Serge Maandag
serge.maandag at staff.zeelandnet.nl
Fri Jan 16 22:39:41 MET 2004
> I'm making a report to see the 1 week and 1 month maximums on
> about 128 different links in my network. I know that I can just do the
> rrdtool fetch command to get the MAX value for each of these
> circuits during the last week and month
rrdtool fetch mydatabase.rrd MAX -s -1w
rrdtool fetch mydatabase.rrd MAX -s -1m
You need to have MAX RRA's in your database, though..
> problem is I'm
> completely lost as to how to make sure I'm selecting the
> correct RRA,
Well, it depends on the number of rows in your RRA. Standard rrd
databases created
by mrtg have (IIRC) something like 2 weeks of 30 minute samples and 2
months of 1 hour
Samples in it's RRA's. so the commands above will safely get you your
data in the highest
resolution available.
> and then from there how when I'm in that RRA how
> I can get the last entry in it for it's values.
The output from a fetch command looks something like this:
ds0 ds1
1074202200: 1.1342348909e+07 4.5883529481e+06
1074204000: 9.8949618797e+06 4.0040870522e+06
<snip>
So to print the highest value, it's a matter of sorting your data on the
column of your desire,
taking only the bottom row and printing only the column you are
interested in.
column=2;rrdtool fetch mydatabase.rrd MAX -s -1w | sort -gk$column |
tail -1 | cut -d" " -f$column
Serge.
-------------
Op de inhoud van dit e-mailbericht en de daaraan gehechte bijlagen is de inhoud van de volgende disclaimer van toepassing: http://www.zeelandnet.nl/disclaimer.php
--
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