Deluge -> InfluxDB

So ever since I got my remote seed box setup from 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 torrents, etc.

Now create the deluge database, user and assign the appropriate permissions.

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"

Copy the following into a file named docker-compose.yml on your docker host and then run docker-compose -d up in the same directory. Just make sure to change anything inside <> so that it matches your setup.

      replicas: 1
    restart: unless-stopped
    image: mvantassel/deluge2influx
      - "INFLUX_PROTOCOL=http"
      - "INFLUX_HOST=<ip.of.influx.db>"
      - "INFLUX_PORT=8086"
      - "INFLUX_DB=<deluge>"
      - "INFLUX_USER=<deluge>"
      - "INFLUX_PASS=<deluge>"
      - "DELUGE_HOST=<ip.of.deluge.client>"
      - "DELUGE_PORT=8112"
      - "DELUGE_PASSWORD=<deluge-password>"
      - "UPDATE_INTERVAL_MS=3000"

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