Export logs from rsync daemon logs as influxdb timeseries
pip install rsyncstats==0.11.1
Parse rsync server logs, compute statistics and store in influxdb.
ringserverstats is distributed on PyPI https://pypi.org as a universal wheel.
$ pip install rsyncstats
This program will fill 2 measurements. You should configure a database for these, and configure a user with write priviledges.
First, create a database, a user, and retention policie.
create database rsyncdb
create user rsync with password 'rsyncer'
grant write on rsyncdb to rsync
grant read on rsyncdb to rsync
create retention policy rp_rsyncevents on rsync duration 1w replication 1
create retention policy rp_rsyncstats on rsync duration 520w replication 1
To work properly, this program needs the following environment variables set :
INFLUXDB_HOST
: The host name or adress of influxdb serverINFLUXDB_PORT
: The port number of influxdb serverINFLUXDB_USER
: The influxdb user to authenticate toINFLUXDB_PASS
: The password to authenticate withINFLUXDB_DB
: The database name containing the metricINFLUXDB_VERIFY_SSL
: Set to yes
or no
to verify SSL connectionINFLUXDB_SSL
: Should the connection go to https ?$ ringserstats txlogs.log
The logs from rsync are metrics suitable for a timeserie database. The idea is to parse the logs, as in the exemple below, and to generate values to insert into an influxdb timeseries database.
The file grafana-dashboard.json
can be imported into grafana to visualize this timeserie.
Used tags in influxdb :
show tag keys from rsyncevents
show tag keys from rsyncstats
The rsyncevents measure has several tags :
Because storing events in the longterm is not very relevant, the rsyncstats
measurement groups all events by day, by host and by network. The retention policies discribed above will manage the time your data get stored in influxdb.
rsyncstats
is distributed under the terms of the GPL v3 or later. See LICENSE file.
python3 setup.py sdist bdist_wheel
tox