I’ve got a nice little Mikrotik box sat between my customers and my main internet circuit and I’d like to keep a web based log of the amount of data they are transferring per month.
I have got Traffic Accounting working and the log downloads onto my server no problem, but ideally I’d like the router to send this data to a database that I can query from either PHP/ASP. I know I can parse the text file, but as that builds it will take too long.
I thought about building a little script that looks at http://10.10.10.200/accounting/ip.cgi every 30 seconds and writes the info to the database, but I don’t know if that will capture all traffic stats. I really need more info on exactly how the web report is generated to do it that way.
Also I can’t seem to find any info on the log file format, any know what it is?
I have been working on a pice of VB Code that does this..
It gets a primary bit count from the MIB and then requeries the router at 1sec. intervals. it then can calculate the bits/sec and total bits accross the interface. the code then writes the data to a SQL database.
The code is working but relies on a com object that I must lic. to redistribute.
Let me know if there is enough interest, I will look into paying for the code.