Accouting time duratin calculation
Hi, how does freeradius calculate duration time? My NAS sends start and stop packet. In mysql table I can see accstarttime and accstoptime. Is the duration time automaticly created from start time and stop time or should NAS also send duration time? In other words is it possbile that freeradius automaticly calculate duration from start and stop packet:)? tnx! miha
Hi, On Wed, Jun 5, 2013 at 7:43 AM, Miha <miha@softnet.si> wrote:
Hi,
how does freeradius calculate duration time?
MySQL query grabs the information from "radacct" i.e. sqlcounter forevertimecounter { counter-name = "Max-All-Session-Time" check-name = "Max-All-Session" count-attribute = "Acct-Session-Time" reply-name = "Session-Timeout" sqlmod-inst = "sql" key = "User-Name" reset = "never" cache-size = "5000" query = "SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='%{%k}'" }
My NAS sends start and stop packet. In mysql table I can see accstarttime and accstoptime. Is the duration time automaticly created from start time and stop time or should NAS also send duration time?
No. Value is stored in "radacct"; rlm_sqlcounter sum the total time. hope this helps !
In other words is it possbile that freeradius automaticly calculate duration from start and stop packet:)?
tnx!
miha - List info/subscribe/unsubscribe? See http://www.freeradius.org/** list/users.html <http://www.freeradius.org/list/users.html>
On Wed, Jun 5, 2013 at 2:43 PM, Miha <miha@softnet.si> wrote:
Hi,
how does freeradius calculate duration time? My NAS sends start and stop packet. In mysql table I can see accstarttime and accstoptime. Is the duration time automaticly created from start time and stop time or should NAS also send duration time?
In other words is it possbile that freeradius automaticly calculate duration from start and stop packet:)?
Should be possible. See https://github.com/FreeRADIUS/freeradius-server/blob/v2.x.x/raddb/sql/mysql/... , look for "accounting_stop_query". It uses Acct-Session-Time by default, but you can edit the SQL query yourself. -- Fajar
participants (3)
-
Fajar A. Nugraha -
Miha -
Russell Mike