[Chilli] free time

Jed Gainer jedgainer at gmail.com
Sat Mar 9 06:40:44 UTC 2013


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.coova.org/pipermail/chilli/attachments/20130308/4107d5b6/attachment.html>


More information about the Chilli mailing list