Hello everyone, in /etc/raddb/sql/mysql/counter.conf there is %b unix time value of beginning of reset period which makes things like sqlcounter counterChilliSpotMaxTotalOctetsDaily { counter-name = ChilliSpot-Max-Total-Octets-Daily check-name = CS-Total-Octets-Daily counter-type = data reply-name = ChilliSpot-Max-Total-Octets sqlmod-inst = sql key = User-Name reset = daily query = "SELECT IFNULL((SUM(AcctInputOctets + AcctOutputOctets)),0) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'" } possible how would i get the value of %b for a user from say PHP so i can calc and show them how much bandwidth they have left?
Jed Gainer wrote:
/etc/raddb/sql/mysql/counter.conf
there is
%b unix time value of beginning of reset period ... how would i get the value of %b for a user from say PHP so i can calc and show them how much bandwidth they have left?
Query the database. The schema is available. Alan DeKok.
I looked though the SQL database. I don't see anything related to %b. On Fri, Dec 7, 2012 at 4:03 AM, Alan DeKok <aland@deployingradius.com> wrote:
Jed Gainer wrote:
/etc/raddb/sql/mysql/counter.conf
there is
%b unix time value of beginning of reset period ... how would i get the value of %b for a user from say PHP so i can calc and show them how much bandwidth they have left?
Query the database. The schema is available.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
%b is the unix time stamp of 8am on current day. mktime(8, 0, 0) in PHP seems to generate the same value as %b if anyone has this same question. :) On Fri, Dec 7, 2012 at 9:11 AM, Jed Gainer <jedgainer@gmail.com> wrote:
I looked though the SQL database. I don't see anything related to %b.
On Fri, Dec 7, 2012 at 4:03 AM, Alan DeKok <aland@deployingradius.com> wrote:
Jed Gainer wrote:
/etc/raddb/sql/mysql/counter.conf
there is
%b unix time value of beginning of reset period ... how would i get the value of %b for a user from say PHP so i can calc and show them how much bandwidth they have left?
Query the database. The schema is available.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Alan DeKok -
Jed Gainer