I’m running FreeRADIUS 3.0.20 and it works fine. In the sqlcounter module, I’m using hourly, daily, weekly, monthly counters. I understand that a hourly counter resets at 0 minutes, and a daily counter resets at midnight, but I have a problem with the weekly counter resetting on Sundays.
The reason is that my system is being used by a group of people with a weekly turnover, which never occurs on Sundays, and they asked to configure the week day for the weekly reset counter.
Is it possible?
This is my weekly counter for session time:
sqlcounter weeklycounter {
sql_module_instance = sql
dialect = ${modules.sql.dialect}
counter_name = Weekly-Session-Time
check_name = Max-Weekly-Session
reply_name = Session-Timeout
key = User-Name
reset = weekly
query = "SELECT COALESCE(SUM(acctsessiontime -
GREATEST((%%b - UNIX_TIMESTAMP(acctstarttime)), 0)), 0)
FROM radacct WHERE username = '%{${key}}' AND
UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%%b'"
}
Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.