Community discussions

MikroTik App
 
bluenobbe
newbie
Topic Author
Posts: 33
Joined: Wed Jan 26, 2005 1:04 pm
Location: Germany

creating e-mail every 1st of month with amount of each user

Wed Jan 26, 2005 1:13 pm

I need a script that create email with the amount of up and download traffic every 1st day in month after that action the script resets the traffic counter of each pppoe-user.

Thank you for help!

I hope my English is good enough to understand...

Nobbe
 
edzix
Member
Member
Posts: 335
Joined: Thu Jul 01, 2004 3:01 pm
Location: Latvia

Wed Jan 26, 2005 1:24 pm

i woul suggest you to use some accounting software to accomplish this. You are welcome to take a look at our application called HotSpot Manager:
http://www.mikrotik.com/download.html#hotspot

Edgars
 
bluenobbe
newbie
Topic Author
Posts: 33
Joined: Wed Jan 26, 2005 1:04 pm
Location: Germany

Wed Jan 26, 2005 2:56 pm

i don`t want to use a Radius Server
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24750
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Wed Jan 26, 2005 2:57 pm

what's the problem with that? it will only make your life easier
No answer to your question? How to write posts
 
bluenobbe
newbie
Topic Author
Posts: 33
Joined: Wed Jan 26, 2005 1:04 pm
Location: Germany

Wed Jan 26, 2005 3:22 pm

the mikrotik hotspot manager have no option to count the amount of traffic up and download together. And my ISP count the traffic in MB not in online-time.I have only 8 User to count and so i think a radius server is too complex. :roll:
 
edzix
Member
Member
Posts: 335
Joined: Thu Jul 01, 2004 3:01 pm
Location: Latvia

Wed Jan 26, 2005 3:46 pm

bluenobbe,

you are wrong! HS Manager supports such a feature. Select necessary users, click on the Sessions button. Then press Print Logs, make sure that Download and Upload are checked and you will be able to the to total count of TX and RX traffic at the bottom of the table.

Edgars
 
bluenobbe
newbie
Topic Author
Posts: 33
Joined: Wed Jan 26, 2005 1:04 pm
Location: Germany

Wed Jan 26, 2005 4:09 pm

but in that way i have no automatical report of user-traffic.
My ISP calculate from the 1st to the next 1st in month.
In my opinion is a script the better way to count the traffic.
So i have a minimum of Expenditure.
 
edzix
Member
Member
Posts: 335
Joined: Thu Jul 01, 2004 3:01 pm
Location: Latvia

Wed Jan 26, 2005 4:29 pm

we will add a new field where you will be able to choose time period when exporting logs to the PDF.

Edgars
 
bluenobbe
newbie
Topic Author
Posts: 33
Joined: Wed Jan 26, 2005 1:04 pm
Location: Germany

Wed Jan 26, 2005 5:38 pm

It sounds good!!!
When do implement that feature?
 
edzix
Member
Member
Posts: 335
Joined: Thu Jul 01, 2004 3:01 pm
Location: Latvia

Wed Jan 26, 2005 6:10 pm

ok, added!
It's placed right there when you will click Print Logs button. In the next window check advanced logs check-box and you will see selected users' logs during specified time period.

Edgars
 
Elfchen
just joined
Posts: 6
Joined: Sat Feb 05, 2005 7:34 pm
Location: Muinch, Germany

Hotspot Manager

Sat Feb 05, 2005 7:47 pm

i woul suggest you to use some accounting software to accomplish this. You are welcome to take a look at our application called HotSpot Manager:
http://www.mikrotik.com/download.html#hotspot

Edgars
Fine - but there is no download link .... how should I use a software without download?
 
cmit
Forum Guru
Forum Guru
Posts: 1552
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Sun Feb 06, 2005 3:46 pm

The MikroTik HotSpot Manager is not an application you can download and install - it's an online service you just use.
Best regards,
Christian Meis
 
bluenobbe
newbie
Topic Author
Posts: 33
Joined: Wed Jan 26, 2005 1:04 pm
Location: Germany

New Desires to the Online Hotspotmanager

Thu Feb 10, 2005 11:54 am

1. Count the traffic and pay for traffic ($ per MB) in the section "hour cost"
2. Count the traffic amount from 00:000 to 23:59 every day (one option is to disconnect all users at midnight)
 
edzix
Member
Member
Posts: 335
Joined: Thu Jul 01, 2004 3:01 pm
Location: Latvia

Thu Feb 10, 2005 5:46 pm

1.there is an idea to implement also MB based cost table;
2.you can see it in the reports if are choosing to show the report for some specific day.

Edgars
 
bluenobbe
newbie
Topic Author
Posts: 33
Joined: Wed Jan 26, 2005 1:04 pm
Location: Germany

amount a day

Mon Feb 14, 2005 1:29 pm

2. i've checked that but it is not correct.
example: User1 logged in at 23:00 and have a amount of traffic in the first hour of 100 MB and in the next 1 hour only 1MB
after that hour the user1 logged out.

in the logfile the amount uf 101MB is calculated in the next day and thats not correct because the amount of 100 MB is caused in the day before.
thats my problem
 
cmit
Forum Guru
Forum Guru
Posts: 1552
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Mon Feb 14, 2005 2:27 pm

The reason for this is that normally accouting data is from the Accounting-Stop packets that the NAS (here: RouterOS) sends to the RADIUS server. And this packet does contains the complete user session (i.e. all online time and data transfer) and is timestamped just when the connection is dropped. That is, the RADIUS server (where the accounting data is collected) doesn't get to know anything about the session until it's finished. This leads to the effect you see.

There' not much to do about it, though. You could use Interim RADIUS packets to update the stats while the connection still is active (i.e. every 5 minutes or so), but I'm not sure if this could be easily (i.e. out-of-the-box) used to split accounting data the way you want it.

Basically all ISPs (at least those doing tarifs by data volume) have this effect, but none of those I know do have a problem with it. That's a kind of "jitter" that will level out over some months. It's right that in theory this could lead to users not using up their "free" volumen for a day or so...

While I'm typing this I come up with an idea how you could do accurate accounting, though (at least if you operate your own RADIUS server):
You could set the Session-Timeout for each session so that the session ultimately is closed (forcefully, from the NAS) just before midnight. Then all accounting data is "billed" to the correct day, and the user could instantly login again. If that's a feasible solution, is up to you...
Best regards,
Christian Meis
 
bluenobbe
newbie
Topic Author
Posts: 33
Joined: Wed Jan 26, 2005 1:04 pm
Location: Germany

Mon Feb 14, 2005 5:22 pm

I have another idea to drop all user connections at midnight
Is it possible to disconnect all leases per script at midnight (timer or something else)??
 
User avatar
YazzY
Member Candidate
Member Candidate
Posts: 140
Joined: Fri May 28, 2004 3:26 pm
Location: Norway, Østfold
Contact:

Wed Feb 16, 2005 12:56 am

You could remotely execute command removing all the interfaces of your connected users with a cronjob.
Login with ssh/telnet -> remove ifaces and wait for calls from angry customers.
I wrote a shell script for remote login and command execution.
It works with both ssh and telnet.
It's bit fancy since I also included dialog menus (I had some spare time).
The whole thing can be easly changed to make it more suitable for running within a cronjob.
Just read the connect_ssh and connect_telnet functions.

The script is avaliable at:
http://yazzy.yazzy.org/coding/shell/rou ... uteros.txt

I tested it with sh on FreeBSD and Gentoo Linux (where /bin/sh -> bash).

Enjoy.

Who is online

Users browsing this forum: n21roadie and 38 guests