Giter Site home page Giter Site logo

kaizensh / qbit-peers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from roadeo/qbittorrent-peers-location-grafana

2.0 0.0 0.0 189 KB

A python script display locations of peers connected to qBittorrent via Grafana

Home Page: https://github.com/kzndotsh/qbit-peers

Python 100.00%

qbit-peers's Introduction

World Map

qbit-peers

Forked from: https://github.com/Roadeo/qbittorrent-peers-location-grafana

A python script (along with instructions) to display the locations of all the peers your qBittorrent client is connected to in a Grafana worldmap dashboard.

Pre-requisites

The following instructions are assuming:

  • Docker is already running and configured
  • Grafana is already running and configured

Instructions

Clone the repository

git clone https://github.com/kaizensh/qbit-peers && cd qbit-peers

Download the IP2Location database

Configure the docker compose file

docker-compose.yml

  • Change /opt/qbit-peers to your desired location
  • Change the password for the MariaDB root user

Configure the python script

qbit-peers.py

  • Configure the qbittorrent server ip, port, username and password
  • Configure the MariaDB host, port, user, password and database name

Run the docker compose file

docker-compose up -d

Stop the qbit-peers container to avoid any potential issues before importing the IP2Location database

docker stop qbit-peers

Import the IP2Location database

IP2LOCATION-LITE-DB5.CSV

Enter the MariaDB container

docker exec -it qbit-peers-mariadb mariadb -uroot -p<password>
USE ip2location;
LOAD DATA LOCAL INFILE '/tmp/IP2LOCATION-LITE-DB5.CSV'
INTO TABLE ip2location_db5
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n';
EXIT;

Start the qbit-peers container

docker start qbit-peers

Configure Grafana

Add the MariaDB datasource

In Grafana, go to Connections > Data Sources > Add new source > MySQL

  • Name: qbit-peers-mariadb
  • Host: qbit-peers-mariadb
  • Database: ip2location
  • User: root
  • Password: <password>

Save & Test

Add the Worldmap Panel

Install the Worldmap Panel plugin: https://grafana.com/grafana/plugins/grafana-worldmap-panel/

Create a new Dashboard

  • Add a new Panel
  • Change Visualization to Worldmap Panel
  • Change the Datasource to qbit-peers-mariadb
  • Change the Format to Table
  • Change the Dataset to ip2location
  • Change the Table to peer_list
  • Change the Column value to geohash

Configure the Worldmap Panel

  • Change the Min circle size to 1 (or your desired size)
  • Change the Max circle size to 1 (or your desired size)
  • Change the Location data to geohash
  • Change the Field mapping to geohash

qbit-peers's People

Contributors

kzndotsh avatar roadeo avatar

Stargazers

 avatar  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.