1

I have an rrd file in which cpu average loads are stored.

I would like to know the Maximum Load during a certain period; let's assume within a day.

I wrote:

rrdtool fetch test.rrd MAX -r 300 -e 1364712300 -s -1h

I got so many MAX numbers, so I have to write more code to get the actual maximum number.

My question is: Can I just write a simple command line to get this MAX number?

Butters
  • 887
  • 1
  • 8
  • 28
user2253717
  • 25
  • 1
  • 4

2 Answers2

3

If you just want a single number, try

rrdtool graph x -s -1h -e 1364712300 \ 
   DEF:v=test.rrd:ds1:MAX VDEF:vm=v,MAXIMUM PRINT:vm:%lf

this will print a single number on STDOUT. No graph will be created since you did not use any graphing instructions.

Tobi Oetiker
  • 5,167
  • 2
  • 17
  • 23
  • Thanks, this was very helpful, but what is the second parameter "x" meant for? I'm using RRDtool 1.3.8 and I had to remove that. – doshea Jan 16 '15 at 05:14
0

I think this will give you the max for every 5 minute period over your specified time range. Try setting the -r 3600 for a 1 hour max, or -r 86400 for a 24 hour max.

You can verify this by looking at the timestamps given to you with the output.

Butters
  • 887
  • 1
  • 8
  • 28