Code Monkey home page Code Monkey logo

collectd-plex's People

Contributors

mpolden avatar nmaggioni avatar rickatnight11 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

Watchers

 avatar  avatar

Forkers

dashbad koosc

collectd-plex's Issues

Error running on CentOS6/7

Is there any plan to upgrade to the latest version of python as I am unable to get this running on CentOS 7

ImportError: No module named requests

First of all, thanks for the effort that is being put into this plugin. I'm setting this up for the first time... when starting collectd it errors out indicating there issues with importing modules (see log entries below).

Nov 30 17:27:15 dionysus collectd[27568]: plugin_load: plugin "python" successfully loaded.
Nov 30 17:27:15 dionysus collectd[27568]: python plugin: Error importing module "plex".
Nov 30 17:27:15 dionysus collectd[27568]: Unhandled python exception in importing module: ImportError: No module named requests
Nov 30 17:27:15 dionysus collectd[27568]: python plugin: Found a configuration for the "plex" plugin, but the plugin isn't loaded or didn't register a configuration callback.
Nov 30 17:27:15 dionysus collectd[27568]: Error: Reading the config file failed!

I'm not seeing where the requests module is located? Not sure if I've missed something.

System info:
OS: CentOS 7
Plex Version: plexmediaserver-1.2.7.2987-1bef33a.x86_64
Python Version: 2.7.5

Let me know if there is any additional info needed. Any assistance is appreciated!

Unhandled python exception

When collectd starts I am getting the following problem:

plex plugin: configured with Namespace(authtoken='neJiTQP65rqsqx#####', episodes=True, exclude=[], host='localhost', https=True, include=[], movies=True, port=32400, sessions=True, shows=True)
Dec 27 15:44:37 plex collectd[1969]: plex plugin: configured with Namespace(authtoken='neJiTQP65rqsqx#####', episodes=True, exclude=[], host='localhost', https=True, include=[], movies=True, port=32400, sessions=True, shows=True)
Dec 27 15:44:37 plex collectd[1969]: Initialization complete, entering read-loop.
Dec 27 15:44:37 plex collectd[1969]: rrdtool plugin: Adjusting "RandomTimeout" to 0.000 seconds.
Dec 27 15:44:37 plex collectd[1969]: Unhandled python exception in read callback: ValueError: zero length field name in format
Dec 27 15:44:37 plex collectd[1969]: read-function of plugin `python.plex' failed. Will suspend it for 20.000 seconds.

instance has no attribute 'iter'

I am getting the following issue when starting collectd:

Unhandled python exception in read callback: AttributeError: _ElementInterface instance has no attribute 'iter'

`Interval` flag not respected

This may 100% be an issue with my collectd install, but I've found the Interval flag (in the LoadPlugin) section of collectd.conf does not change the query frequency of collectd-plex. A simple solution would be to add a parser argument, and pass it as the second parameter in the following line:

 collectd.register_read(get_metrics)

As it stands, I see collectd-plex query the server every 15 seconds, and no matter how many changes I made to collectd.conf, nothing changed this behavior. By changing the above line to:

 collectd.register_read(get_metrics, 60)

I see the update interval drop to the expected 60 seconds.

I would have expected that the Interval flag set in the LoadPlugin python section would work, but it did not. Below is the relevant sections of my config:

 <LoadPlugin python>
   Globals true
   Interval 60
 </LoadPlugin>

...

 <Plugin python>
     ModulePath "/usr/local/src/collectd-plex"
     Import "plex"
     Interval 60
   <Module plex>
     Host "******"
     Port 32400
     AuthToken ******
     Interval 60
   </Module>
 </Plugin>

As expected, the two Interval flags in the <Plugin python> section and subsection do nothing: they simply raise warnings for unexpected flags.

Doesn't work with PMS >1.2.5

does not work since 1.2.6

Unhandled python exception in read callback: KeyError: 'friendlyName'
read-function of plugin `python.plex' failed.
Exiting normally.
exec plugin: Sent SIGTERM to 0

My graphana graphs stopped updating on 11/4, which is the day that 1.2.6 came out. I update every release, so I was able to tie it to this.

Implement HTTPS/SSL and Auth support

Plex Media Server now supports HTTPS/SSL and authentication tokens. Need to write a script to easily obtain an authentication token and then modify plex.py to use it and optionally support https.

Support more than media counts

There are other metrics one might want, such as active sessions. Change the code to support any number of metric types.

PLEX Update sending malformed JSON

The sessions stats part of this appears to be broken in the latest versions of PMS (1.2.2.2857) as invalid JSON is being returned when a session is open, it works fine if PMS has no content playing but as soon as I play various items, sometimes it says invalid JSON returned and sometimes it moans about delimiters depending on the item I play.

Someone else has done some digging and has slightly more accurate information on the issue here:

https://forums.plex.tv/discussion/238197/malformed-json-response-from-status-sessions-query

the reply appears to be "use XML" as they don't officially support JSON and it was more luck than judgement that made it work in the first place.

Doesn't work with PMS >= 1.3.2.3112

Since the latest update, the script does no longer work.

I am getting the following error when I execute ./plex.py --movies --shows --episodes 127.0.0.1 32400 SECRET_TOKEN

  File "./plex.py", line 329, in <module>
    get_metrics(collectd=False)
  File "./plex.py", line 34, in get_metrics
    sections = get_sections()
  File "./plex.py", line 134, in get_sections
    for section in sectionobject['MediaContainer']['Metadata']:
KeyError: 'Metadata'```

If you need any additional information, feel free to tell me.

OS: Ubuntu 16.04
Python version ~2.7

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.