[rrd-users] Creating monthly and daily datatraffic graphs
Simon Hobson
linux at thehobsons.co.uk
Tue Mar 20 14:35:22 CET 2007
Erik Hensema wrote:
>We're using mrtg to collect interface stats of our switch and store
>the data using rrdtool.
>
>Since we're charging our customers on a monthly basis on the total
>data transferred, I'd like to create graphs per month.
>I guess this won't be possible with the graph function of rrdtool,
>since a month has no fixed length, so no interval can be given.
Yes it can. rrdtool simply graphs the period you tell it to - if you
tell it to graph a period covering one calendar month then it will do
so. All you need to do is work out what start and end times you need
for each month which isn't all that hard :
start = "00:00 01-mm-yyyy"
end = "00:00 01-MM-YYYY" - $interval
where mm-yyyy is the month required, MM-YYYY is the result of adding
one to the month and dealing with crossing a year end, and $interval
is your graphing resolution. The results should be expressed as
seconds since epoch.
Actually, I'm not entirely sure if you need to subtract the interval.
More information about the rrd-users
mailing list