sqlcounter instance not found in modules section

Russell Stockhammer russgrue at 329ncle.no-ip.org
Tue Oct 2 13:43:16 CEST 2012


Hey Everyone,

I'm trying to create a new sqlcounter instance that counts octets.  I 
think
what I've done is correct but I get the following error when I start
FreeRadius...

--------

Mon Oct  1 21:09:41 2012 : Error:
/usr/local/etc/raddb/sites-enabled/default[203]: Failed to find 
"dailyoctetcounter" in the "modules" section.
Mon Oct  1 21:09:41 2012 : Error: 
/usr/local/etc/raddb/sites-enabled/default[69]: Errors parsing authorize 
section.
Mon Oct  1 21:09:41 2012 : Error: Failed to load virtual server <default>

--------

This error also occurs when I change the name of "dailycounter" to be
"dailytimecounter".

My relivant config is as follows...

---- radius.conf ----

instantiate {

         dailycounter
         dailyoctetcounter

}

---------

---- sql/mysql/counter.conf ----

sqlcounter dailyoctetcounter {
         counter-name = Daily-Session-Octet
         check-name = Max-Daily-Session-Octet
         reply-name = ChilliSpot-Max-Total-Octets
         sqlmod-inst = sql
         key = User-Name
         reset = daily

         query = "SELECT SUM(acctinputoctets + acctoutputoctets) \
                  FROM radacct WHERE username = '%{%k}' \
                  AND UNIX_TIMESTAMP(acctstarttime) > '%b'"
}

sqlcounter dailycounter {
         counter-name = Daily-Session-Time
         check-name = Max-Daily-Session
         reply-name = Session-Timeout
         sqlmod-inst = sql
         key = User-Name
         reset = daily

         query = "SELECT SUM(acctsessiontime - \
                  GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \
                  FROM radacct WHERE username = '%{%k}' AND \
                  UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"
}

--------

---- sites-enabled/default ----

authorize {

         dailycounter {
                 reject = 1
         }
         if (reject) {
                 update reply {
                         Reply-Message := "Your daily time limit is up!"
                 }
                 ok = reject
         }

         dailyoctetcounter {
                 reject = 1
         }
         if (reject) {
                 update reply {
                         Reply-Message := "Your daily transfer limit is 
up!"
                 }
                 ok = reject
         }

}

--------

Is there a set of keywords that are only valid for sqlcounters?  Or like I
think anything that isn't already another instance should be vaild. Please
tell me where I'm going wrong with my config.

Thanks
Russ


More information about the Freeradius-Users mailing list