rlm_sqlcounter: Some strangenesses.

George Koulyabin jumbo at vinf.ru
Wed Aug 26 09:08:44 CEST 2009


Hi.

I am running FR v2.1.6.

I am needing to generate some quota for users. This quota must be replied via attribute Cisco-Control-Info.
I tryed to do this by different ways. I was interested by rlm_sqlcounter, as simple and powerful method of calculating of counters.
I built test counter:
 sqlcounter noresetoutputoctetscounter {
        counter-name = Max-All-Output-Octets
                check-name = Max-All-Output
                reply-name = Cisco-Control-Info
                #reply-name = Session-Timeout
                sqlmod-inst = sql
                key = User-Name
                reset = never

        query = "SELECT COALESCE(SUM(AcctOutputOctets), 0) \
                        FROM radacct \
                        WHERE UserName = '%{%k}' AND (CiscoServiceInfo = '' OR CiscoServiceInfo IS NULL)"

 }

I inserted Max-All-Output attribute/value pair into radcheck and added 'noresetoutputoctetscounter' into authorize section.

a.) I set Max-All-Output to 100000000 and used Session-Timeout as reply-name when first experiment was. Result of query was 60842094 for all experiments. I had got true result for this case.

b.) I increased value of Max-All-Output to 700000000 and had got 700486142. But this value is greater then value of check-name (Max-All-Output).

c.) Reply-name was replaced with Cisco-Control-Info by me. Cisco-Control-Info has type of string and Session-Timeout has type of integer. When I looked into log I found that "rlm_sqlcounter: Sent Reply-Item for user guest, Type=Cisco-Control-Info, value=700486142". But reply-list went with empty Cisco-Control-Info: 'Cisco-Control-Info = ""'.

Where can I find information about restrictions of rlm_sqlcounter?



More information about the Freeradius-Users mailing list