Git Product home page Git Product logo

tautulli-influxdb-export's Introduction

tautulli-influxdb-export

This script will query Tautulli to pull basic stats and store them in influxdb. Stay tuned for further additions!

I suggest you intall the script as a service to boot with your OS.

Dependencies

Parameters

  • --interval (in seconds, default: 5)
  • --tautulliwebprotocol (http/https, default: http)
  • --tautullihost (default, localhost)
  • --tautulliport (default: 8181)
  • --tautulliapikey (required, default: empty)
  • --tautullibaseurl (default: empty)
  • --influxdbhost (default: localhost)
  • --influxdbport (default: 8086)
  • --influxdbuser (default: empty)
  • --influxdbpassword (default: empty)
  • --influxdbdatabase (default: tautulli)

Example

python /path/to/tautulli_influxdb_export.py --tautullihost <host> --tautulliapikey <key>

Docker Example

cd <folder>
docker build -t tautulli_influxdb_export .
docker run -d --name=tautulli_influxdb_export --restart unless-stopped -e TAUTULLI_HOST=<host> -e TAUTULLI_KEY=<key> -e INFLUXDB_HOST=<influxdbhost> -e INFLUXDB_DB=<influxdbdatabase> tautulli_influxdb_export

Exported Data

  • Activity
    • # Total Streams
    • # Total Streams (Playing)
    • # Transcode Streams
    • # Transcode Streams (Playing)
    • # Direct Play Streams
    • # Direct Play Streams (Playing)
  • Users
    • # Total Users
    • # Home Users
    • # Users currently streaming concurrently
    • # Users currently streaming conurrently (with different IP addresses)
  • Libraries
    • # Total Items Per Library
  • more to come...

To Do:

  • Activity
    • # Audio Transcode Streams
    • # Audio Transcode Streams (Playing)
    • # Audio Direct Play Streams
    • # Audio Direct Play Streams (Playing)
  • Users
    • Current Streaming Users Location Data (via IP lookup)

Use-Case

With the data exported to influxdb, you can create some useful stats/graphs in graphing tools such as grafana (http://grafana.org/)

alt tag

tautulli-influxdb-export's People

Contributors

drewster727 avatar halkeye avatar shuaiscott avatar tidusjar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tautulli-influxdb-export's Issues

Queries

Is there a listing of data points/queries we can pull from this? I'm kind of new to all this. I'm not sure what the values would be.

Also, when looking at the output of the script, I just see a bunch of lines as follows:
python[31707]: Expecting value: line 1 column 1 (char 0)

Cannot seem to get it to work

So trying to get this to work

Info:
Python version 2.7
Command run:

plexpy_influxdb_export.py --plexpyhost localhost --plexpyapikey APIKEY_REMOVED --plexpyport 8084

Nothing output and nothing happens.

I created the database in InfluxDb called plexpy there are no measurements.

It would be useful to print something out to the console, since there is no feedback at the moment :)

Expecting value: line 1 column 1 (char 0)

Hey, not sure if this is still active, but I can't seem to get it to work.

Running it with
logan@grafana:~/tautulli-influxdb-export$ python plexpy_influxdb_export.py --plexpyhost <plexpyhost> --plexpyapikey <apikey taken from website> --influxdbhost <host>

I keep getting
Expecting value: line 1 column 1 (char 0)

I have a different base url set so its /plexpy/home and I tried all that in different configurations and I still get that same error.

Any help is appreciated!

OS: Ubuntu 16.04
Python Version: 2.7.12
PlexPY Version: 2.1.18

Also tried on another Ubuntu Server VM and got:
No JSON object could be decoded

Errors when starting

After starting I get the following output, but nothing happens and nothing is getting into influxdb.

I am using the latest PlexPy from git.

Started
400: {"error":"error parsing query: found NOT, expected ; at line 1, char 20"}

'unicode' object has no attribute 'read'
'unicode' object has no attribute 'read'
'unicode' object has no attribute 'read'
'unicode' object has no attribute 'read'

404 page not found

root@metrics:/lib/systemd/system# /usr/bin/python /opt/plexpy-influxdb-export/plexpy_influxdb_export.py --plexpywebprotocol https --plexpyhost plexpy.home --plexpyport 8181 --plexpyapikey 9<censored>6 --influxdbhost 192.168.1.144 --influxdbuser influxdb --influxdbpassword influxdb
Started
404: 404 page not found

404: 404 page not found

404: 404 page not found

python 2.7.9
plexpy: 1.4.20
plex: 1.7.3.x

i also had to do pip install -U requests, because it was giving me an error originally about not being able to import something.. Any idea what the 404 is from?

url manually works in browser:

https://plexpy.home:8181/api/v2?apikey=9<redacted>6&cmd=get_activity

results in:

{"response": {"message": null, "data": {"stream_count": "0", "sessions": []}, "result": "success"}}

Added Direct stream as a option

First of all, I love your script! Thanks for sharing.
I wanted to make a graph based on the stream type. But I only can choose for direct play and transcode. If I want to see the direct stream count I need to choose transcode. Is it possible to added direct stream as a separate option like direct play and transcode?

Direct Stream noted as Transcode

I pulled the latest version as you told me yesterday. But I ran into a issue. When I create a graph the direct streams are noted as transcode. See Attachment.
Maybe its a problem with plexpy, but the graphs in plexpy are correct.
grafana
plexpy

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.