RE: dailycounter isnt started
Guys, I found the right code from the Daloradius /sql/counter.conf. In all my googling I have not seen it like this. I found it a little tough when the wiki and Github show code that does not work for a daily-max-session. I guess there is a reason but loads of the examples out there simply don't work unless the radacct table is already populated, cheers. sqlcounter dailycounter { counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = daily query = "SELECT IFNULL(SUM(acctsessiontime - \ GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)),0) \ FROM radacct WHERE username = '%{%k}' AND \ UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'" Regards Jim
On 8 Mar 2014, at 02:11, Sanity Computers <sales@sanitycomputers.com.au> wrote:
Guys, I found the right code from the Daloradius /sql/counter.conf. In all my googling I have not seen it like this…
I found it a little tough when the wiki and Github show code that does not work for a daily-max-session… I guess there is a reason but loads of the examples out there simply don’t work unless the radacct table is already populated, cheers.
sqlcounter dailycounter { counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = daily query = "SELECT IFNULL(SUM(acctsessiontime - \ GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)),0) \ FROM radacct WHERE username = '%{%k}' AND \ UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"
Regards
If this is with version 3, I just pushed some fixes for various rlm_sqlcounter issues, along with some tweaks to make the debug output a bit more understandable. I believe it should fix this issue... Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (2)
-
Arran Cudbard-Bell -
Sanity Computers