Deluge -> InfluxDB

Alex's Guardian > Blog > Homelab Things > Grafana > Deluge -> InfluxDB

So ever since I got my remote seed box setup from seedboxes.cc I have been trying to figure out the best way to get Deluge stats to show up in my Grafana stack.

I first tried a Deluge Exporter for Prometheus but it didn’t seem to work as it required the config directory of Deluge in order for it to export the stats. Really dumb but its whatever. I then came across a influxdb script that sent Deluge stats to Influx. However, that did not work either as apparently the /json endpoint used a self signed certificate and the script errored because of that.

BUT, I got that script to actually work though! Had to use a deluge “thin client” to connect to the remote seed box and basically mirror the data locally. This was done by running a deluge container in docker and using the connection preferences to connect to Cerberus (my remote seedbox).

W.I.P. Deluge Influx dashboard.

Now a quick note here, this dashboard is currently a full WIP as I learn what data is what and how to properly visualize it in Grafana.

What you will need to set this up

First make sure you have docker installed and setup (preferably on a Linux host). Then make sure you have your deluge client setup and configured properly for hosting Linux ISO downloads, etc.

First create the deluge database, user and assign the appropriate permissions. If you do not have a Grafana/Influx stack going see my guide here.

curl -XPOST "http://ip.of.influx.db:8086/query" -u admin:password --data-urlencode "q=CREATE DATABASE 'deluge'"

curl -XPOST "http://ip.of.influx.db:8086/query" -u admin:password --data-urlencode "q=CREATE USER deluge WITH PASSWORD 'deluge'"

curl -XPOST "http://ip.of.influx.db:8086/query" -u admin:password --data-urlencode "q=GRANT WRITE ON deluge TO deluge"

curl -XPOST "http://ip.of.influx.db:8086/query" -u admin:password --data-urlencode "q=GRANT READ ON deluge TO grafana"

Create a exporters folder inside your Influxdb directory.

# BASH [ LINUX VM ]
mkdir /opt/containers/influxdb/exporters && mkdir /opt/containers/influxdb/exporters/deluge

Copy the following into a file to your docker host and then edit it to match your setup.

# BASH [ LINUX VM ]
curl https://bin.alexsguardian.net/raw/deluge2influx -o /opt/containers/influxdb/exporters/deluge/deluge2influx-compose.yml
# BASH [ LINUX VM ]
nano /opt/containers/influxdb/exporters/deluge/deluge2influx-compose.yml

When you finish editing hit CTRL+X then Y to save and close the file.

Now startup the container.

# BASH [ LINUX VM ]
docker-compose -f /opt/containers/influxdb/exporters/deluge/deluge2influx-compose.yml up -d

Create a new dashboard in Grafana and import this .json file. Note that this dashboard expects the data source in Grafana to be called “deluge”.