Giter Club home page Giter Club logo

mikrocount's Introduction

Mikrocount

Go Report Card Software License Build Status

Mikrocount is a suite of tools that aid in visualising external network activity that goes through a Mikrotik router. It consists of:

  • mikrocount: The application hosted in this repo, which periodically fetches accounting data from the Mikrotik router and feeds it to Influxdb.
  • influxdb: Time-series data store. Mikrocount stores data in a database named mikrocount, in a single measurement named usage, with a field of bytes and tags of direction (Upload or Download) and ip.
  • grafana: Awesome tool for visualising the data stored in Influxdb.

Installing

Configuring the Mikrotik router

Your Mikrotik router will need to be configured properly in order to expose accounting data to the local network. Run the following commands in your router's terminal:

/ip accounting
set enabled=yes threshold=2000
/ip accounting web-access
set accessible-via-web=yes

Note:

  • If your network is very busy, you should set the threshold to a higher value. Mikrocount queries the Mikrotik router for data every 15 seconds.
  • It is strongly recommended that access to your router from the internet over HTTP/HTTPS be blocked by the firewall.
  • The accounting feature of Mikrotik doesn't appear to work properly at all for packets that are fasttracked. If you want accurate results from this tool, I recommend you disable the fasttrack feature.

Running the Mikrocount suite

Requirements:

  • A computer capable of running Docker, with Docker and docker-compose already installed.
  • The computer should preferably be running 24/7.

docker-compose config

  1. On the computer on which you want Mikrocount to run, create a file named docker-compose.yml, in a directory named mikrocount.

  2. Copy the contents of the file docker-compose-example.yml in this repository, and paste them into the newly created docker-compose.yml file.

  3. Change the value after -mikrotikaddr in the file to the LAN IP address of your Mikrotik router.

  4. In a terminal session, in the mikrocount directory that was created run:

    $ docker-compose up -d --build
    ...

    (note: some setups may require you to run the aforementioned command using sudo).

  5. After all images have been downloaded and containers are running, wait a minute or so before proceeding.

  6. Open http://<ip of machine running mikrocount>:3000 in a browser. You should be presented with a Grafana login page.

  7. Login using username/password admin/admin. The "Mikrocount Dash" dashboard should be immediately available.

Stopping and starting the suite

  • To stop everything: docker-compose stop
  • To start everything: docker-compose start
  • To delete everything except persisted data: docker-compose down
  • To start everything again: docker-compose up -d --build
  • To delete persisted data: docker-compose down --volumes

Development

In order to contribute to the development of this project, or to fork and make your own changes, you'll need the following:

To install the required dependencies, run dep ensure, or make deps while in the mikrocount subdirectory.

Using docker-compose-dev.yml as a reference is recommended for creating a docker-compose config for your development environment.

License

This software is distributed under the MIT License. See the LICENSE file for more details.

Donations

Donations are very welcome, and can be made to the following addresses:

  • BTC: 1AWHJcUBha35FnuuWat9urRW2FNc4ftztv
  • ETH: 0xAF1Aac4c40446F4C46e55614F14d9b32d712ECBc

mikrocount's People

Contributors

johanmeiring avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.