How do I create accumulated bandwidth usages in RRDtool (ie. GB's per month down)?

吃可爱长大的小学妹 提交于 2020-01-06 21:01:17

问题


The following data comes from a mobile phone provider, it's a list of kb's downloaded at a certain time, usually on a per minute basis.

It's not the average, not the max, but the total of that time interval, which allows to track the data consumption precisely. These graphs were made with PIL, and instead of showing spikes to indicate a large data consumption, large steps can be seen, which is much more revealing, because it doesn't just tell "much happened here", but "exactly this much happened here". For example second graph Sat 10 at night 100mb. A rate-change graph wouldn't be as informative.

I'm also trying to find a way to do this with rrd.

I was mislead when using the COUNTER to track my networks data usage into thinking that I would be able to precisely compute the monthly/weekly accumulated data usage, but now it turned out to be a wrong assumption.

How I store my data in rrd in order to be able to easily generate graphs like below? Would that be by using ABSOLUTE and before updating it I would subtract the previous insertion value? Would that be precise down to the byte when checking the monthly usage?


回答1:


You can add up all the value in your chart quite easily:

CDEF:sum=data,$step_width,*,PREV,ADDNAN

if your chart covers just one month, that should be all you have todo. If you want to have it cover multiple months, you will have to use a combination of IF and TIME operators to reset the line to 0 at the start of the month.

Version 1.5.4 will contain an additional operator called STEPWIDTH, which pushes the step width onto the stack, making this even simpler.



来源:https://stackoverflow.com/questions/31812055/how-do-i-create-accumulated-bandwidth-usages-in-rrdtool-ie-gbs-per-month-down

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!