[rrd-users] Can I get a single update into an RRA?
linux at thehobsons.co.uk
Fri Dec 11 18:33:16 CET 2009
David Mitchell wrote:
>I have a problem I've run into with some statistics I'm trying to
>gather. I am getting wireless client statistics from all of my access
>points via SNMP and putting the values into RRD files. All of my values
>are GAUGE's. Specifically, connection quality (S/N ratio basically) and
>connection time. I keep one RRD file per client per access point. I
>create a directory for each client MAC, and in that directory I have an
>RRD file for each access point the client has shown up on.
>The problem I run into is that some clients are connected so
>sporadically that I rarely get two updates in a row so nothing ever
>makes it into my RRAs. I can increase the heartbeat to increase the
>chances that the client will get picked up twice in the same RRD file.
>That helps, but I do end up with fictional values in the RRA making it
>appear that the client was connected for a period of time when it
How about having your scripts update the rrd files with "unknown" any
time the client isn't accessible ? You can then tune the rrd to
configure how much of each step must have data in it for the data to
be accepted. That way, when a client comes online, there will be a
previous data point for rrdtool to work with.
Eg, you update every minute.
At present, you do nothing for missing clients. A client becomes
visible at time 00:05, but rrdtool has no previous update to
associate this one with - so it cannot work out a rate.
If you update all files every minute, then when the client comes
online at 00:05, rrdttol has a previous update at 00:04 to work from.
The data will now be unknown up to 00:04, and then a rate calculated
from the update for the period from 00:04 to 00:05.
If updating all files all the time would be too much work, then the
next best things would be to do historical updates when required.
Taking the same example as above, at time 00:05 you find a client has
come online. Before doing an update, you work out if there has been
an update since 00:04 (or as far back as you decide to go - going
back 2 sample periods would allow for slight delays in script run
times). If not, then update the file with unknown at time 00:04
followed by the recorded value at time 00:05.
The thing to remember is that even when you use a gauge data type,
internally rrd still woks in rates - it only ever works in rates.
When you update a gauge datatype, rrd works out the rate for the
previous period by dividing the value you give it by the time
interval between the previous and current updates and stores that. It
can only do this if it has a previous update time (that is within the
heartbeat interval) to work with.
Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.
More information about the rrd-users