I would like to ignore bandwidth usage between 2 and 5 am. 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 UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > UNIX_TIMESTAMP(CONCAT(CURDATE(),' ', '00:00:00')) AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime NOT BETWEEN UNIX_TIMESTAMP(CONCAT(CURDATE(),' ', '02:00:00')) AND UNIX_TIMESTAMP(CONCAT(CURDATE(),' ', '05:00:00'))" } Should I do it all in the SQL like that? or does someone have a better idea.
I would still like to be able to see what they use via my admin panel I just want FR to ignore it. On Sat, Mar 9, 2013 at 2:07 AM, <A.L.M.Buxey@lboro.ac.uk> wrote:
Hi,
I would like to ignore bandwidth usage between 2 and 5 am.
why not change things so you dont insert such bandwidth into your system
eg in the accounting section, in pseudo code (this isnt working code or unlang!)
if (time isnt between 2am and 5am){ sql }
alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Sun, Mar 10, 2013 at 8:23 AM, Jed Gainer <jedgainer@gmail.com> wrote:
I would still like to be able to see what they use via my admin panel I just want FR to ignore it.
Then use different database for it. Something like if (time isnt between 2am and 5am){ sql-for-normal-usage } else { sql-for-your-admin-panel } As usual, do lots of testing. On first glance, your sql query looks fine when you're only dealing with small number of accounting records, but would REALLY suck if you have lots of it (say, 10 million records in radacct). -- Fajar
Why use a different DB? On Sat, Mar 9, 2013 at 4:28 PM, Fajar A. Nugraha <list@fajar.net> wrote:
On Sun, Mar 10, 2013 at 8:23 AM, Jed Gainer <jedgainer@gmail.com> wrote:
I would still like to be able to see what they use via my admin panel I just want FR to ignore it.
Then use different database for it. Something like
if (time isnt between 2am and 5am){ sql-for-normal-usage } else { sql-for-your-admin-panel }
As usual, do lots of testing. On first glance, your sql query looks fine when you're only dealing with small number of accounting records, but would REALLY suck if you have lots of it (say, 10 million records in radacct).
-- Fajar - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Sun, Mar 10, 2013 at 2:12 PM, Jed Gainer <jedgainer@gmail.com> wrote:
Why use a different DB?
Different table is also fine, really. However in FR terms when you use something different (e.g. different query, table, or database), you configure it as separate sql instances. Assuming you create your own admin panel, or can custimize it, you can do something like this: - one radacct table to store "normal" accounting entries - one raddcct_free (or whatever) table to store accounting records in "free" times. Your admin panel can then access both records by executing queries on both table, and use UNION (or SUM, depending on the query) to join the results together. It should be much more resource-efficient compared to using complex WHERE queries. -- Fajar
participants (3)
-
A.L.M.Buxey@lboro.ac.uk -
Fajar A. Nugraha -
Jed Gainer