Giter VIP home page Giter VIP logo

syncflux's Introduction

syncflux

Report statistics from Syncthing instances to influxdb. You can configure multiple syncthing and influxdb instances.

Data points are sent for two different measurements:

  1. All registered devices, fields=last_seen_since_sec, tags=id, name
  2. All local folders, fields=completion (percent), tags=id, label, path

For all data points, my_id and my_name tags are added (id and name of the reported syncthing instance).

Example use case: you can visualize this with Grafana, and also setup alert rules to notify the admins when something goes wrong:

Example Grafana Dashboard

Installation

The recommended way is to use pipenv to create a virtual environment:

git clone [email protected]:nagylzs/syncflux.git
cd syncflux
pipenv install --skip-lock

Since syncflux is a single Python script, you can also install the required packages globally instead. Check Pipenv file for required packages.

Configuration

Copy syncflux_example.yml into syncflux.yml, and edit to your needs.

Main configuration sections:

  • syncthings - named configurations for Syncthing instances
  • influxes - named configurations for InfluxDb instances
  • measurements - configure your measurement names here

Run

You can start syncflux from command line or cron:

pipenv run python syncflux.py -c syncflux.yml

Use --help for command line options.

Run as a windows service

The easiest way to run syncflux as a service on Windows is to use the non-sucking service manager.

  • Download NSSM from here.

  • Create a new service with:

    nssm.exe install syncflux

  • Use the following settings:

    • Application path: point to pipenv.exe (e.g. "C:\Program Files\Python10\python.exe")
    • Startup directory: point to the directory containing syncflux.py and Pipenv
    • Arguments: run python syncflux.py --count=-1 --silent --config=syncflux.yml but pleae refer to --help for all options.
    • Change your display name, description, startup type as desired.
    • If you have used pipenv, then give your credentials on the "Log on" tab. Also, you need to enable "service log on" for your user account.
    • Alternatively, if you have installed python and all required packages globally, then you can use local system account.
    • On the "Shutdown" tab, leave "Control+C" checked, but uncheck all others (WM_CLOSE, WM_QUIT, Terminate process)
    • Carefully check options on "Exit actions" tab. If you choose to use "restart application" then you should always set "deplay restart by" to a sensible value.

syncflux's People

Contributors

nagylzs avatar

Watchers

 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.