4

I have setup a mrtg setup with rrdtool. Now I'm planning to get incoming outgoing usage data from these RRD files and failing to find a correct way to do it.

Can anyone show we how to get those usage data from rrd files?
Then I can maintain a db to keep those usage data and calculate the cost etc.?

vinzee
  • 10,965
  • 9
  • 34
  • 51
Yasiru G
  • 6,218
  • 5
  • 18
  • 37

1 Answers1

7

you can use rrdtool graph ... PRINT:xxx or rather rrdtool xport ... to get data out of the rrd file. If you want to get to the actual data, use rrdtool fetch.

you can find tons of additional info on http://rrdtool.org

Tobi Oetiker
  • 4,591
  • 2
  • 15
  • 22
  • Thank you Tobi :) I found a useful command 'rrdtool fetch xxx.xxx.xxx.xxx_gi0_1.123.rrd AVERAGE -r 300' and I'm now playing with it. Let me explain my problem here; I was using mrtg setup with .log files and now I have convert it to rrdtool. I was collecting usage from .log files every 5 minute and now I want to do the same thing with RRD files. I hope this can be done using rrdtool fetch. Any advice appreciate. – Yasiru G Jan 24 '13 at 06:26
  • Hi Tobi Oetiker, I use 'rrdtool fetch xxx.xxx.xxx.xxx_gi0_x.xxxx.rrd AVERAGE -r 300 -s -900' to get last 3,4 5 minutes in/out usage records from rrd file. But I cannot file any similarities if I compare it with the data of log file (the graphs are same). Please help! – Yasiru G Jan 25 '13 at 06:08
  • don't know what is going wrong for you ... if the graph is the same, so should the data ... if you use -s 900 you get the time slot from 15 minute ago, so maybe this is an issue. – Tobi Oetiker Feb 01 '13 at 16:42
  • I cannot understand a single word of what your are trying to explain. sorry. How do I fill the `...` in? – MUY Belgium Sep 25 '20 at 07:39
  • The ... stand for whatever rrdtool graph commands you use in your scenario – Tobi Oetiker Oct 15 '20 at 11:49