How to read RRD file to get usage data?
Asked Answered
A

1

6

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.?

Aged answered 24/1, 2013 at 4:43 Comment(0)
N
11

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

Neologize answered 24/1, 2013 at 5:44 Comment(6)
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.Aged
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!Aged
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.Neologize
I cannot understand a single word of what your are trying to explain. sorry. How do I fill the ... in?Paleoasiatic
The ... stand for whatever rrdtool graph commands you use in your scenarioNeologize
I am getting syntax error when I am using this. rrdtool fetch my.rrdAnatropous

© 2022 - 2024 — McMap. All rights reserved.