<div dir="ltr">Hi,<div>i'm configuring a server with a sql counter to check the total byte in a week for the users.</div><div>But the server will reply a wrong count.</div><div><br></div><div>Here's the counter:</div>

<div><br></div><div>sqlcounter weeklybytecounter {</div><div>counter-name = Weekly-Total-Max-Octets</div><div>check-name = Max-Weekly-Octets</div><div>reply-name = Mikrotik-Total-Limit</div><div>sqlmod-inst = sql<br>
</div><div>key = User-Name  </div><div>reset = weekly  </div><div>query = "SELECT (SUM(acctinputoctets)+SUM(acctoutputoctets)) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"</div>

<div><br></div><div><br></div><div>But the reply doesn't is the operation between (check-name value) - (query value)<br><br></div><div>for example:</div><div><br></div>







<p>rlm_sqlcounter: Authorized user fabrizio, check_item=3000000000, counter=38101894</p><p>I expect a reply of 3000000000 - 38101894 = 2961898106</p><p>but i receive different value also bigger.....</p>
<p><br></p><p>Any idea ?</p><br clear="all"><br>-- <br>Fabrizio Fiore Donati<br><br>Mobile: +39 3289872420<br>E-mail: <a href="mailto:fabrizio.fioredonati@2bite.net" target="_blank">fabrizio.fioredonati@2bite.net</a><br>
<br>2bite s.r.l.<br>Via Saragat snc<br>67100 L'Aquila (AQ) - Italy<br>Tel.: +39 0862441583
</div>