in reply to How to do session times The Right Way

Checkout the radius attribute "Acct-Session-Id" To paraphrase:

This attribute is a unique Accounting ID to make it easy to match start and stop records in a log file. The start and stop records for a given session MUST have the same Acct-Session-Id. An Accounting-Request packet MUST have an Acct-Session-Id. An Access-Request packet MAY have an Acct-Session-Id; if it does, then the NAS MUST use the same Acct-Session-Id in the Accounting-Request packets for that session.

(http://www.freeradius.org/rfc/rfc2866.html#Acct-Session-Id)

So, for each accounting request packet, you've got a timestamp, and know how many users are on the BRAS at ayone point in time, simply by counting the acct-sess-id.

Be warned tho', the amount of data can be huge, and you may want to look at something like partitioning, or summary tables for historical data.

Update: Further to this, i never explicitly mentioned its prolly a good idea to stick it into an RDBMS, where you can do any number of different queries to produce different statistics at the drop of a hat. You also have the advantage of being able to leverage of any number of dba utilities to maintain the database.

  • Comment on Re: How to do session times The Right Way