Community discussions

MikroTik App
 
ekkas
Long time Member
Long time Member
Topic Author
Posts: 567
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Status.html edit question.

Wed Sep 29, 2010 11:08 pm

ROS 4.11

I've installed yet another Hotspot, but clients are limited by Transfer limit(limit-bytes-total).

They want to be able to see how much MB they have left but I only see :
* bytes-in - number of bytes received from the user ("15423")
* bytes-in-nice - user-friendly form of number of bytes received from the user ("15423")
* bytes-out - number of bytes sent to the user ("11352")
* bytes-out-nice - user-friendly form of number of bytes sent to the user ("11352")
* packets-in - number of packets received from the user ("251")
* packets-out - number of packets sent to the user ("211")
* remain-bytes-in - remaining bytes until limit-bytes-in will be reached ("337465" or "---" if there is no limit)
* remain-bytes-out - remaining bytes until limit-bytes-out will be reached ("124455" or "---" if there is no limit)

Is there any way to show total bytes used or total bytes left (user-friendly way) so they at least can get an idea on how much used (total, not just for this session) and/or how much is left.
remain-bytes-total-nice is the variable I'm looking for...

Ekkas
PS: It sucks that transfer-limit must be entered as bytes (in usermanager web page), I tried 200mb, 200MB 200Mb but only 200000000 works...
Any possibility that it can be changed/added Mikrotik guys?
 
shaneau
just joined
Posts: 20
Joined: Sun Jul 04, 2010 6:31 am

Re: Status.html edit question.

Sat Nov 27, 2010 9:53 am

This would be great. Anybody have a solutions?

<EDIT>

Found a solution here...
http://forum.mikrotik.com/viewtopic.php?f=2&t=32874



<script language="JavaScript">

function readablizeBytes(bytes) {
var s = ['bytes', 'kb', 'MB', 'GB', 'TB', 'PB'];
var e = Math.floor(Math.log(bytes)/Math.log(1024));
return (bytes/Math.pow(1024, Math.floor(e))).toFixed(2)+" "+s[e];
}

</script>


<tr><td align="left">Megabytes Remaining:</td><td><script language="JavaScript">document.write(readablizeBytes($(remain-bytes-out)));</script></td></tr>
 
User avatar
bax
Member Candidate
Member Candidate
Posts: 268
Joined: Mon Dec 20, 2004 8:45 pm
Location: Croatia

Re: Status.html edit question.

Mon Jan 24, 2011 11:27 pm

Nice !
Does anybody know how to show Time remaining in status page , for users which have account with time usage?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Status.html edit question.

Mon Jan 24, 2011 11:30 pm

Nice !
Does anybody know how to show Time remaining in status page , for users which have account with time usage?
http://wiki.mikrotik.com/wiki/Manual:Cu ... _variables
session-time-left - session time left for the user ("5h" or "" if none)
session-time-left-secs - session time left for the user, in seconds ("3475" or "0" if there is such timeout)
 
User avatar
bax
Member Candidate
Member Candidate
Posts: 268
Joined: Mon Dec 20, 2004 8:45 pm
Location: Croatia

Re: Status.html edit question.

Tue Jan 25, 2011 11:47 am

http://wiki.mikrotik.com/wiki/Manual:Cu ... _variables
session-time-left - session time left for the user ("5h" or "" if none)
session-time-left-secs - session time left for the user, in seconds ("3475" or "0" if there is such timeout)
[/quote]

Thanks !
I been add this line and now show time left :
<td align="left">Time Remaining:</td>
 <td> $(session-timeout) </td> </tr>
 
MICPROF
Member Candidate
Member Candidate
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: Status.html edit question.

Tue Mar 01, 2011 6:17 am

<tr><td align="left">Megabytes Remaining:</td><td><script language="JavaScript">document.write(readablizeBytes($(remain-bytes-out)));</script></td></tr>
NOt work , would you please help me , i need this script work if possible , i will wait you
 
cmacneill
Member Candidate
Member Candidate
Posts: 293
Joined: Sun Apr 01, 2007 10:51 pm
Location: Christchurch, New Zealand

Re: Status.html edit question.

Sat Apr 16, 2011 5:05 am

Hi,

This problem seems to have been left hanging with no solution. MikroTik Support Guys, this needs a response as it appears to be a bug.

I have the same issue in that the documented $(remain-bytes-in) and $(remain-bytes-out) do not get substituted correctly when using total bytes limiting rather than separate values for in and out bytes. This has been tried on v4.10, v4.13, v4.16 and v4.17 and doesn't work in any of them.

Either needs variables to work correctly as documented or new variables provided which work when using total bytes limiting.

P.S. $(limit-bytes-in) and $(limit-bytes-out) don't work either.

Regards

Chris Macneill
 
ekkas
Long time Member
Long time Member
Topic Author
Posts: 567
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Status.html edit question.

Sat Apr 16, 2011 8:58 pm

I second that. If it must be for ROS5 as that's the new official version, so be it, but we'll love to have this option regardless.
All our hotspots are on total bytes limit and a pain is the ... to constantly lookup usage for control-freak clients.
 
User avatar
bax
Member Candidate
Member Candidate
Posts: 268
Joined: Mon Dec 20, 2004 8:45 pm
Location: Croatia

Re: Status.html edit question.

Mon Mar 05, 2012 9:40 pm

Yes in latest ROS 5.xx this is not working ...
 
solelunauno
Member Candidate
Member Candidate
Posts: 119
Joined: Mon Jul 16, 2012 7:00 pm
Location: Roseto Capo Spulico CS Italy
Contact:

Re: Status.html edit question.

Tue May 27, 2014 12:24 pm

You can use limit-bytes-total as variable in status.html page.
I tested it with 6.9 firmware and it works well.
It isn't documented in http://wiki.mikrotik.com/wiki/Manual:Cu ... #Variables , but it's implemented.
 
omelendres
just joined
Posts: 10
Joined: Tue Mar 10, 2009 11:06 am

Re: Status.html edit question.

Fri Oct 03, 2014 10:58 am

The variable limit-bytes-total is also available in ROS version 5 but not documented
 
solelunauno
Member Candidate
Member Candidate
Posts: 119
Joined: Mon Jul 16, 2012 7:00 pm
Location: Roseto Capo Spulico CS Italy
Contact:

Re: Status.html edit question.

Thu Aug 06, 2015 5:01 pm

Now with Routeros 6.30.2 I tested the variables $(remain-bytes-total) and $(remain-bytes-total-nice) and they work.
So i think it's time to update http://wiki.mikrotik.com/wiki/Manual:Cu ... ng_Hotspot with those new and useful variables, in order to prevent time losses looking for other way to obtain those informations for users in status page.
Thanks Mikrotik support
 
corkuck
just joined
Posts: 18
Joined: Wed Jan 22, 2014 9:06 pm

Re: Status.html edit question.

Tue Jan 19, 2016 5:55 am

If it's not working for you try this. I'm running MikroTik RouterOS ver. 6.9.

I struggled with
NaN (Not A Number) when trying the following Variables:
remain-bytes-in
remain-bytes-out
limit-bytes-in
limit-bytes-out

I kept getting nothing or NaN or not defined or showed nothing out at all.

For days this was KILLING ME........... then I found out this. So I have to share. It needs posted all over. So many of us that have or are struggled with this can be over. Works great once you do what's shown below, for the above variables shown to work.

Using your WAN IP address:
http://<WAN IP-Adds>/userman
Login:
Password:
Click Routers
Click on your router name
Click on down arrow of Radius incomming
Uncheck the CoA support: X Use CoA
It's a BOX that needs unchecked
Click Save
Click Logout
Reboot your router. The change of CoA will not take place or work unless you reboot.

It's my understanding that, with CoA checked, the User Manager sends out, nothing or zeros, for the above variables until you uncheck CoA. and reboot the router.

Good Luck so glad I'm passed this one, on to the next. What a great product........

Happy Mikrotik,,ing

/rk
 
melhem101
just joined
Posts: 2
Joined: Sun Sep 16, 2018 6:43 pm

Re: Status.html edit question.

Sun Sep 16, 2018 7:13 pm

You can use limit-bytes-total as variable in status.html page.
I tested it with 6.9 firmware and it works well.
It isn't documented in http://wiki.mikrotik.com/wiki/Manual:Cu ... #Variables , but it's implemented.
is there anyway to chamge that to gb or mb instead of bytes ?
 
3rdrail
just joined
Posts: 8
Joined: Fri Jun 21, 2019 4:31 am

Re: Status.html edit question.

Tue Jun 25, 2019 5:51 am

ROS 4.11

I've installed yet another Hotspot, but clients are limited by Transfer limit(limit-bytes-total).

They want to be able to see how much MB they have left but I only see :
* bytes-in - number of bytes received from the user ("15423")
* bytes-in-nice - user-friendly form of number of bytes received from the user ("15423")
* bytes-out - number of bytes sent to the user ("11352")
* bytes-out-nice - user-friendly form of number of bytes sent to the user ("11352")
* packets-in - number of packets received from the user ("251")
* packets-out - number of packets sent to the user ("211")
* remain-bytes-in - remaining bytes until limit-bytes-in will be reached ("337465" or "---" if there is no limit)
* remain-bytes-out - remaining bytes until limit-bytes-out will be reached ("124455" or "---" if there is no limit)

Is there any way to show total bytes used or total bytes left (user-friendly way) so they at least can get an idea on how much used (total, not just for this session) and/or how much is left.
remain-bytes-total-nice is the variable I'm looking for...

Ekkas
PS: It sucks that transfer-limit must be entered as bytes (in usermanager web page), I tried 200mb, 200MB 200Mb but only 200000000 works...
Any possibility that it can be changed/added Mikrotik guys?
Here's my script to show the remaining mb they left. I put this code at the Status and Logout page:
$(if remain-bytes-out)
<tr>
<td>connected / left:</td>
<td>$(remain-bytes-out) / $(remain-bytes-total-nice)</td>
</tr>
$(else)
<tr>
<td>remaining data:</td>
<td>$(remain-bytes-total-nice)</td>
</tr>
$(endif)

Hope this helps!

Who is online

Users browsing this forum: No registered users and 12 guests