Skip to main content

A python plugin for collectd to get stats from a runnning transmission server.

Project description

Introduction

A python plugin for integrating collectd and transmission. With this installed, collectd will be querying transmission for the following:

Per session and cumulative:

  • downloadedBytes

  • uploadedBytes

  • filesAdded

  • secondsActive

General:

  • activeTorrentCount

  • blocklist_size

  • downloadSpeed

  • uploadSpeed

  • pausedTorrentCount

  • torrentCount

and creating the relevant RRD files (or pushing to graphite or whatever you have collectd doing)

Some of these metrics are per session, some session cumulative, some are session independent. Their type ‘current’, ‘cumulative’, ‘general’ is set in the name of the metric

Compatibility

Developed and tested on Debian Wheezy system.

That means:

  • collectd 5.1

  • transmissionrpc 0.8

But testing has also been conducted on Debian Jessie systems. Which means:

  • collectd 5.4

  • transmissionrpc 0.11

It is expected Debian Jessie will be the main playground soon

Feel free to submit PRs for other systems support

How to install

Prerequisites

Those are collectd and transmission

I assume a Debian system here, amend accordingly for your system

If you have not already installed transmision, install it:

apt-get install transmission-daemon

The above install the daemon cause a headless box is assumed. It should probably work with a non headless box as well and a normal transmission installation but this has not been tested.

Install the python transmission binding

apt-get install python-transmissionrpc

Install collectd.

apt-get install collectd

Install collectd_transmission

There are two ways to achieve this for now

Use the python package

pip install collectd_transmission

Do it manually

Clone the repo, copy the module directory somewhere in your fileystem

Configure

Insert the following in your collectd.conf:

<Plugin python>
    ModulePath "/path/to/module/dir" # Not needed if installed via pip or package
    LogTraces false
    Interactive false
    Import "collectd_transmission"
    <Module collectd_transmission>
        username "myuser" # Required
        password "mypass" # Required
        address "http://localhost:9091/transmission/rpc" # Optional, defaults to "http://localhost:9091/transmission/rpc"
        timeout "5" # Optional, defaults to 5
    </Module>
</Plugin>

modified accordingly to your needs. Restart collectd and you are done.

sudo service collectd restart

There should be rrds for transmission under collectd’s data directory. Most probably that is /var/lib/collectd/rrd/<hostname>/transmission/

How to display your data

Well if you got collectd, you probably already have a way of displaying your data anyway. If you don’t there are various frontends available at:

https://collectd.org/wiki/index.php/List_of_front-ends

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collectd_transmission-v2.0.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file collectd_transmission-v2.0.tar.gz.

File metadata

File hashes

Hashes for collectd_transmission-v2.0.tar.gz
Algorithm Hash digest
SHA256 b6b81177b1d2a5fe01923ce5afeaa9cdb141dca0a5df9de4f5e86a13d9a76ff0
MD5 fb898e4199c1cf0ac8639fcf84b7a407
BLAKE2b-256 1553ba64be30c47e866a2419972064c61c482190456a677a3dd11c9f569c3f5f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page