On 6/18/2010 1:28 PM, Adam Thompson wrote:
> Thank you very much! I never know how to extract the raw data from rrdlogs,
> now I know it's actually not that hard.
>
> (BTW: the AWK is fine, although you can omit the cut(1) stage in the pipe
> simply by having awk add up $2 and $3 instead of $1 and $2.)
And for my next trick, this one works in whatever month you run it:
rrdtool fetch /var/db/rrd/wan-traffic.rrd AVERAGE -r 3600 -s "00 `date
'+%m/01/%Y'`" -e now | grep -v nan | awk '{ sum1 += $2/(1024*1024); sum2
+= $3/(1024*1024) } END { printf "IN: %u Mbytes OUT: %u Mbytes\n",
sum1*3600, sum2*3600; }'
Thanks for the reminder, re: cut/awk.
It wouldn't be too difficult to add this to the GUI if we can confirm
that the results are indeed accurate.
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Commercial support available - https://portal.pfsense.org