<div dir="ltr"><font face="trebuchet ms, sans-serif">Do the following</font><div><font face="trebuchet ms, sans-serif"><br></font></div><div><font face="trebuchet ms, sans-serif"><br></font></div><div><span style="font-family:'trebuchet ms',sans-serif">STEP 1:</span><br>
</div><div><font face="trebuchet ms, sans-serif"><br></font></div><div><span style="font-family:'trebuchet ms',sans-serif">nano counters.conf</span><br></div><div>
<p class=""><font face="trebuchet ms, sans-serif">sqlcounter dailycounter {</font></p>
<p class=""><font face="trebuchet ms, sans-serif"> counter-name = "Daily-Session-Time"</font></p>
<p class=""><font face="trebuchet ms, sans-serif"> check-name = "Max-Daily-Session"</font></p>
<p class=""><font face="trebuchet ms, sans-serif"> reply-name = "Session-Timeout"</font></p>
<p class=""><font face="trebuchet ms, sans-serif"> sqlmod-inst = "sql"</font></p>
<p class=""><font face="trebuchet ms, sans-serif"> key = "User-Name"</font></p>
<p class=""><font face="trebuchet ms, sans-serif"> reset = "daily"</font></p>
<p class=""><font face="trebuchet ms, sans-serif"> cache-size = 5000</font></p>
<p class=""><font face="trebuchet ms, sans-serif"> query = "SELECT SUM(acctsessiontime) FROM radacct WHERE username = '%{%k}' AND acctstarttime BETWEEN FROM_UNIXTIME('%b') AND FROM_UNIXTIME('%e')"</font></p>
<p class=""><span style="font-family:'trebuchet ms',sans-serif">}</span><br></p>
<p class=""><font face="trebuchet ms, sans-serif"><br></font></p></div><div><font face="trebuchet ms, sans-serif">STEP 2:<br></font></div><div><font face="trebuchet ms, sans-serif"><br></font></div><div><font face="trebuchet ms, sans-serif">nano radiusd.conf</font></div>
<div>
<p class=""><font face="trebuchet ms, sans-serif">instantiate {</font></p>
<p class=""><font face="trebuchet ms, sans-serif"> dailycounter</font></p>
<p class=""><font face="trebuchet ms, sans-serif">}</font></p>
<p class=""><br></p></div><div><font face="trebuchet ms, sans-serif">STEP 3: </font></div><div><font face="trebuchet ms, sans-serif"><br></font></div><div><font face="trebuchet ms, sans-serif">nano sites-available/default</font></div>
<div><font face="trebuchet ms, sans-serif"><br></font></div><div>
<p class=""><font face="trebuchet ms, sans-serif">authorize {</font></p></div><div>
<p class=""><font face="trebuchet ms, sans-serif"> dailycounter</font></p><p class=""><font face="trebuchet ms, sans-serif">}</font></p></div><div><font face="trebuchet ms, sans-serif"><br></font><div class="gmail_extra">
<font face="trebuchet ms, sans-serif">STEP 4: </font></div><div class="gmail_extra"><font face="trebuchet ms, sans-serif"><br></font></div><div class="gmail_extra">
<p class=""><font face="trebuchet ms, sans-serif">accounting {</font></p><p class=""><font face="trebuchet ms, sans-serif">sql</font></p><p class=""><font face="trebuchet ms, sans-serif">}</font></p><p class=""><font face="trebuchet ms, sans-serif">STEP 5: LOOK, THIS MUST BE <b><font color="#ff0000">CHECK & REPLY</font></b> ITEM NOT CHECK ONLY. BOB IS ALLOWED FOR 60 MINUTES, VALUE IS IN SECONDS. </font></p>
<p class=""><font face="trebuchet ms, sans-serif"><span style="font-size:13px">Max-Daily-Session := 3600</span><br></font></p><p class=""><span style="font-size:13px"><font face="trebuchet ms, sans-serif"><br></font></span></p>
<p class=""><span style="font-size:13px"><font face="trebuchet ms, sans-serif">STEP 6: Restart Radius Daemon</font></span></p></div><div class="gmail_extra">RM --</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, May 12, 2014 at 11:28 AM, * <span dir="ltr"><<a href="mailto:zhex900@gmail.com" target="_blank">zhex900@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<p dir="ltr">Hi,</p>
<p dir="ltr">I have to follow this tutorial to get the the session limit working. But looking at the debug output it seems the sql counter is not executed. No Session-Timeout is sent to NAS as well.</p>
<p dir="ltr">Accounting is working fine. I can see all the accounting information radacct time. </p>
<p dir="ltr">Here is my configuration. Please let me know if I should provide more information.</p>
<p dir="ltr">Jake He</p>
<p dir="ltr">FreeRADIUS V. 3</p>
<p dir="ltr">mods-enabled/sqlcounter </p>
<p dir="ltr">sqlcounter noresetcounter {<br>
sql_module_instance = sql<br>
#dialect = ${sql_module_instance}.dialect<br>
dialect = mysql<br>
counter_name = Daily-Session-Time<br>
check_name = Max-Daily-Session<br>
reply_name = Session-Timeout<br>
key = User-Name<br>
reset = never<br>
query = “SELECT SUM(AcctSessionTime) FROM radacct where UserName=’%{%k}’”<br>
} </p>
<p dir="ltr">sites-enabled/default:</p>
<p dir="ltr">authorize {</p>
<p dir="ltr">preprocess<br>
chap<br>
mschap<br>
suffix<br>
eap<br>
files<br>
sql<br>
pap<br>
noresetcounter<br>
}</p>
<p dir="ltr">radcheck:<br>
Max-Daily-Session:=60 for the user bob<br>
</p>
<br>-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br></blockquote></div><br></div></div></div>