Hi Guys
I am busy writing a script that grabs information for all the users on my RB1100 and then writing it to a MySQL database. Since it writes more that 500 lines per second (Yes I know), I have a second script that runs every 5 minutes. This script I called “historical data”. It calculates all the bytes for each user in the first table, then writes it in the historical data table from which I read when I do reporting.
Now, the only language I know is PHP. I write the daemon also in PHP, but it only runs for a few hours and then some times crashes or just stops polling the router.
I need to get a more reliable method of reading the accounting for my l2tp users. I will share the code for my scripts here so you guys can see what it is I am doing.
This is the link to the data collector which query’s the mikrotik’s accounting table.
http://pastie.org/6623549
The data collector daemon and RB1100 is not on the same physical network. I believe that the $API->connect() function should sit inside the endless loop of the daemon. Could this be the problem?
Thanks for the help.