use of rlm_sqlcounter & rlm_counter for time & data

I am using MT 2.9 with freeradius and mysql.

I have successfully configured rlm_sqlcounter and it’s working fine with Max-Daily-Session, Max-All-Session and Max-Monthly-Session.

I would like to know can I use this module for checking data usage as well. Or is there any other module available for checking data usage limit and disconnects users if it exceeds. (I suppose one option would be rlm_counter, but don’t know how to implement that in freeradius. I checked on the net but no luck).

Any help with procedure/documentation on the same is appreciable.

Thanks & Regards, Ravi

No but I modified the source and recompiled it so it can but has to be installed as a new module.

http://forum.mikrotik.com//viewtopic.php?p=56655&highlight=#56655

Nobody was interested when I did it ages ago :wink:

thanks for your help. have configured this module successfully, but have some queries:

  1. can I change dataunit from GB to KB
  2. If users data limit is full is it possible to send reply msg like " Your data download limit is full"
  3. When I entered Mikrotik-Xmit-Limit-Gigawords := 1 in radcheck table, in debug mode it shows Mikrotik-Xmit-Limit = 1000000000, what does it mean ?
  4. in your configuration counter name is monthlycounter, but same countername is available in rlm_sqlcounter for time check. I changed monthlycounter to monthlydatacounter.
  5. Also have you made changes regarding 1.5 GB limitation ?
  1. can I change dataunit from GB to KB

I think so but you would have to fiddle with the math on the sql counter bit in radius.conf

  1. If users data limit is full is it possible to send reply msg like " Your data download limit is full"

I thought it did! You can modify the source code though to give whatever error messages you want!

  1. When I entered Mikrotik-Xmit-Limit-Gigawords := 1 in radcheck table, in debug mode it shows Mikrotik-Xmit-Limit = 1000000000, what does it mean ?

1g = 1000000000 bytes

  1. Also have you made changes regarding 1.5 GB limitation ?

No I was not good enough at programming. Still if it reached and logged out when you log back in it recalculates it again.

Hi

It doesn’t seem to be working while users data limit reaches, it should disconnect that user.

I think it may be because you changed the countername. They are in built to freeradius and you need to use monthlycounter if you want the limit to reset monthly. So you can have a monthly limit or a once only limit or whatever.

I changed counter name only because I’m using rlm_sqlcounter for checking time limit as well. In rlm_sqlcounter there is monthlycounter which I think will conflict with monthlycounter of rlm_sqldatacounter. Please let me know if I can use same countername.

Also I changed data unit from GB to MB. GB, MB & TB are defined in module.

Yes, you have to use the same counters. There is no probs having two monthly counters. It’s just that they reset monthly.

Hello Ravin,
Can you give me little howto setting freeradius + rlm_counter ?
I’ve been search all over the internet but cannot find any better howtos.
Thank You

Faizal

Hello Ravin,
Can you give me little howto setting freeradius + rlm_counter ? PLSSSSS

Hi

Visit this links:

http://wiki.freeradius.org/Rlm_sqlcounter

I have use this wiki…but counter not work !!!

Can you give me your configurations file ???

Hi

Give me your email id…

cfch2@hotmail.com
tnx a lot