Hi,
Please find my radius -X output.
Now, for some reason. It give this error:
sqlcounter_expand: 'SELECT IFNULL(SUM(acctsessiontime - GREATEST((0 - UNIX_TIMESTAMP(acctstarttime)), 0)),0) FROM radacct WHERE username = '%{User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '0''
(9) ERROR: noresetcounter : %{sql:SELECT IFNULL(SUM(acctsessiontime - GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)),0) FROM radacct WHERE username = '%{%k}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'}SELECT IFNULL(SUM(acctsessiontime - GREATEST((0 - UNIX_TIMESTAMP(acctstarttime)), 0)),0) FROM radacct WHERE username = '%{User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '0'}
(9) ERROR: noresetcounter : ^ Invalid variable expansion
This is my sqlcounter
sqlcounter noresetcounter {
sql_module_instance = sql
#dialect = ${sql_module_instance}.dialect
dialect = mysql
counter_name = Daily-Session-Time
check_name = Max-Daily-Session
reply_name = Session-Timeout
key = User-Name
reset = never
query = "SELECT IFNULL(SUM(acctsessiontime - \
GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)),0) \
FROM radacct WHERE username = '%{%k}' AND \
UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"
}