plexMonitor - (In Development)

I'm in the process of forking the Network Status Page application and making it into a fully featured server monitoring tool tuned for Plex Systems. I'm currently adding Windows functionality to the codebase and in the coming weeks I will be doing a complete overhaul of the existing framework and migrating the entire UI to AngularJS. I'll be working to make setup easier and find ways at increasing cross-platform options. Once I've restructured the codebase I'll being working on additional features and getting this thread cleaned up and more official.
My repository is located here: https://github.com/vanstinator/PlexMonitor

PHP dependencies you should have enabled on your system:

  • php_curl
  • php_openssl

 

Current build is plexMonitor-0.2.1alpha. These first releases will be buggy. Please report issues you have on your setup and I will use the information to make the code more robust.

 

Changelog v0.2.1alpha

  • Fixed bug with total disk space.
  • I've started reworking the services module to be dynamic, but it's not really working yet.

 

Changelog v0.2.0alpha

  • UPS and Bandwidth modules can be hidden. Keep local_pfsense_ip and apcupsd_server_ip blank to accomplish this.
  • Windows users can now locally query apcaccess by putting the full path to the apcupsd bin folder in apcupsd_path_to_bin under their [misc] settings.
  • All commands that are run via shell_exec now also check to see if the IP address is local. If not they'll automatically SSH to the box instead. Valuable for people like me who have Plex on one machine but the apcupsd/bandwidth tools are on two or more boxes and require fetching. If your services are only local no need to supply names and passwords.
  • Plex stuff now shows Recently Added instead of Recently Released. I'll be making this a set of options in the future.
  • General bug fixes. There may be more stuff behind the scenes. I've made a lot of random commits this week. Most of the new stuff I'm only recently running at home so there are probably bugs. Once these get sorted I'm going to start working my thoroughly on the back-end rewrite. I just want to get all of you off the ground first.

 

plexMonitor is a server monitoring tool that is capable of retrieving various stats about your server. Currently the codebase works on Linux, OSX, and Windows. Current features include:

  • System Load/CPU & RAM - Depends on underlying OS
  • Weather
  • Services running on your server/network such as Plex, CouchPotato, Sonarr, etc.
  • Total storage capacity, and by disk breakdown
  • UPS stats such as voltage in, time left until battery dies, load, battery level, etc
  • show recently released movies that you have in plex
  • show now playing when something is streaming
  • some ability to hide modules. more to come.

These features are currently in an alpha stage along with the rest of the application. They will be fleshed out with additional features and configuration options as time goes on. I am currently rewriting large portions of the code-base to bring it up to an MVC standard. I'll be providing fixes and enhancements here and there to the master branch as I complete portions of functionality.

 

Planned features include:

  • built in settings manager vs. the current config.ini file
  • modularity of the modules. i.e. you can decide where in the grid your modules will live.
  • the ability to hide modules - partially implemented
  • show recently added to plex - partially implemented
  • notifications of events. "events" TBD
  • potential integration with plexWatch, but not planned anytime soon if ever. just an idea
  • more to come...

Here are a few screenshots. I don't have a demo site setup yet, but you can go to the parent project of this site and see one there. I'm essentially feature complete with that so far.

 

Windows

[spoiler]jmmcdnO.png[/spoiler]

 

Linux/OSX

[spoiler]lDZJJyn.png[/spoiler]

This is awesome. Cant wait for new stuff!

I've updated the Plex token retrieval code and pushed it to the repository. This now officially works on Windows out of the box. Please report any bugs you find. I've also started porting major pieces of logic to JSON formatted output. This code isn't in the repository yet but I"m making good progress locally on the rewrite of the backend. I'll probably start the UI work in the next few days.

Van, does this also look at the history of who has watched as well as synced content?  How they watched it 9transcoding, streaming or playing) and what settings the synced content was set at?  (highest, high, etc.)

Are you thinking about setting it up for push notifications?  (New users, changed users, new content, etc.)

Are you going to get this working with Perl or Python?

Tons more thoughts here, just wanted to get these out while I'm not suffering keyboard forehead!

In a word to your first question. No.

But long term we'll see. For now PlexWatchWeb does all of that and it's a beautiful implementation and works fantastically. I don't think it's a best use of my time right now to be duplicating existing functionality when I think there is good potential in the monitoring area. That being said yes, I will definitely be adding push notifications. I was already suffering keyboard forehead last night while trying to get this out so you can blame that for lack of insight in my roadmap.

I'm not a web developer by trade, I'm an enterprise java guy. So I'm using this as a learning experience for frontend webdev right now. I've dabbled in PHP in the past and that helps as the codebase I forked was obviously all in PHP. If I end up swapping out backend tech I think I'm moving it to node for the sake of learning node. This isn't actually planned right now and before I change anything like that I'd need to see who/what my userbase was made up of so if I change it'll have community involvement.

My biggest goal right now is to get the codebase cleaned up, refactored, and stable on all 3 major platforms. That by itself is going to take some time.

I gave it a shot on a windows box running IIS and just got some expletives, an error of sorts...

Tried my Plex username and password but it didn't seem to connect for me. RAM and storage did however display! 

Oh hey, that showed up? That was a debug message last night after getting angry at PHP when it wasn't flowing through my code. I removed it locally... commit didn't grab it. Yeah I'm still working on my commit process and workflow so debug statements don't show up. I humbly apologize. If you would like to remove it yourself it's in assets/php/plex.php. 5th or 6th line.

As for your plex issues. Can you look in assets/caches/plex_token.txt.  See if that exists, and if so is there a token in it?

Hey Vanstinator,

Love what you have done here, been waiting for this page to become available on Windows platforms.  I have the page up and running on Server 2012 running apache.  Having a couple of issues and wanted to see if you could help me out.  Attached is a screenshot of what's going on.  I get what looks like a token from plex but don't get the actual info.  I checked to see if that plex_token.txt existed but I don't see it.  It also looks like the Trakt.tv isn't working, I just get broken image preview.  Also, do you happen to know if you can add Mapped Network Drives to the Storage section?  I tried a couple of different ways but it doesn't seem to show anything.  Let me know if you need more information or want me to help you test any of this.  I can help you test stuff if you need someone to.

Thanks,

Ryan

Looks like the apcupsd isn't working as well.  I tried localhost as well as the ip of the server in which neither worked.  apcupsd is up and running and is reporting.

Some of this could be user error as well.

I'll have to look at this in depth after work but I can do a quick overview on a few things now.

Trakt.TV isn't supported. The trakt team actually removed widgets with the site redesign and so I'm actually going to pull all trakt.tv functionality out. I'm going to instead replace it with full Plex integration to display the same information.

It's strange that your plex token is being echoed on screen. I think that one of the commits I made last night may not have updated all the files properly as I had cleaned up or deleted most of those. I'll do a compare on my local repository this evening and see what is going on. That commit that seems to have not properly gone through is also the commit that contains the new piece of code that allows Windows systems to get and store a Plex token. You're obviously getting one, so I'm not sure why it isn't getting stored. I need to put a list of PHP dependencies together yet, it's possible you're missing one.

Mapped network drives work. Mine are actually mapped. Just do your standard 'DriveLetter:/,Drive name' and it should work. You can PM me your config.ini file you want and I'll take a look. Make sure to remove your passwords first, obviously.

Thank You for porting this to windows.

can you post which PHP extensions need to be enabled for this. so far i had to enable

php_curl.dll

php_openssl.dll

but in Recently Released section, Plex screenshots are not being displayed

i am on windows box with nginx as webserver

while i was troubleshooting i found that in functions.php

on line 25 you are pooling wan1 -- from network section which is not in config file

on line 26 you are pooling wan1 -- from network section which is not in config file

on line 27 you are polling ping_ip from Network section, but it is in the MISC section

I only use curl and openssl. I'll update the docs to show this. As far as images go please create a folder named caches in your assets folder. This isn't getting created when the plex token code tries to write to a file there and it will be rectified in the bugfix release.

As a general note I'll have a bugfix release posted tonight. I'll be releasing a new feature build tomorrow that contains some further support for Windows users and additionally provides a way to hide certain modules that a user may not want to use. I've also noticed another thread on the forums that uses the same name as I picked, so I will likely be changing the name of my project in the near future.

Don't worry about it, I'm was planning on changing my name anyway (and the members gave me some good suggestions)

New stuff! Sort of. Mostly some code cleanup and tweaks. Geronimo!!!

Changelog v0.2.0alpha - https://github.com/vanstinator/PlexMonitor/releases/tag/v0.2.0alpha

  • UPS and Bandwidth modules can be hidden. Keep local_pfsense_ip and apcupsd_server_ip blank to accomplish this.
  • Windows users can now locally query apcaccess by putting the full path to the apcupsd bin folder in apcupsd_path_to_bin under [misc] settings.
  • All commands that are run via shell_exec now also check to see if the IP address is local. If not they'll automatically SSH to the box instead. Valuable for people like me who have Plex on one machine but the apcupsd/bandwidth tools are on two or more boxes and require fetching. If your services are only local no need to supply names and passwords.
  • Plex stuff now shows Recently Added instead of Recently Released. I'll be making this a set of options in the future.
  • General bug fixes. There may be more stuff behind the scenes. I've made a lot of random commits this week. Most of the new stuff I'm only recently running at home so there are probably bugs. Once these get sorted I'm going to start working my thoroughly on the back-end rewrite. I just want to get all of you off the ground first.

This looks super interesting! I'll look into getting it set up when I get a few more cycles. Are you looking for any help with development? I'm not great, but I'd love to sink my teeth into something new. :-)

Hello again,

Using the latest version I've a couple of issues (Windows / IIS). Screenshot attached.

1) It seems that it displays 'Plex Offline' at the top, even though it's clearly showing online down the left side.

2) The total disk capacity usage seems to be out of whack...

3) My Trakt username is correct but it never seems to display any information

4) CPU usage does not display... I'm running VMWARE but can get this displayed in CPU-Z etc, can this be changed?

4) Can we change to degrees C, rather than F?

5) Can we add additional services down the side?

It's coming on well, and the swear box is no longer taking coins ;-)

Good work.

Glad you're enjoying it! Let me try to answer your questions:

  1. Please edit the assets/php/functions.php line that says display_errors and set it to true. PM me a screenshot.
  2. Yeah because maths. It'll be patched next release. My bad.
  3. Trakt recently updated their API and don't support widgets at the moment/anymore. I'll be pulling all trakt support in a future release.
  4. See number 1. Also what OS are you running?
  5. Nope. but I can potentially provide an option in a later release to toggle. I've yet to look at that part of the code yet myself too, so I don't know what all gets pulled from forecast.io and what gets manually added.
  6. Supported and implemented, just not enabled. The old way was hardcoded, my way will be all config.ini based so anyone can add anything. This is on my roadmap above.

And yes, I've removed erroneous debug statements that were inserted the night I forked the code-base. It was a grand time getting this to work.

Changelog v0.2.1alpha - https://github.com/vanstinator/PlexMonitor/releases/tag/v0.2.1alpha

  • Fixed bug with total disk space.
  • I've started reworking the services module to be dynamic, but it's not really working yet.

PSSST - you linked to v0.2.0alpha in your previous post. Here is the correct URL -https://github.com/vanstinator/PlexMonitor/releases/tag/v0.2.1alpha

I've been correcting issues for myself (most recently with the URL the PlexService class assigns to the link button). Is there any point in issuing pull requests from github since you're reworking the services anyways?

I'd like to help where I can.

So, I jumped the gun and added a pull request.

I got rid of the phpseclib0.3.5 NET SSH2.php includes and opted to use libssh2 which can be installed for php5 on apache by simply doing:

 sudo apt-get install libssh2-php

then

Make sure /etc/ssh/sshd_config contains: PasswordAuthentication yes make changes and do:

sudo service ssh restart

and maybe for fun:

sudo service apache2 restart

on pfsense you need to set up a second admin user with these settings (username not important, as long as it matches whats in your config):

otherwise, you get the pfSense cli menu instead of a shell prompt. Also, you'll obviously need SSH into pfSense open.

To give you an idea of what my environment looks like:

Fileserver (ZFS on solaris vm, one 14TB pool)

PLEX server (Win7 vm with mapped drives to FileServer)

sab/couchpotato/sonarr (Ubuntu server vm with mount points to FileServer smb shares)

test webserver (Ubuntu server vm hosting this PlexMonitor site)

Everything is reverse-proxied through the pfSense box (so it all appears as port 80 from WAN urls) but are all kinds of 8080, 8333, 8888 kind of ports internally.

This setup of mine poses some challenges with getting CPU meter values in the top right from the transcoder box, as well as getting the disk space statuses (I could pull from any of 3 machines and should still get the same value as long as the paths are correct for the machine it is querying) On the sab vm, if I were to use that IP to poll disk status the path might be /mnt/smb_shares/MediaTank as opposed to the Z:\ on the PLEX server box. I also envision all the polling happening over SSH (common to all platforms) and then detecting the OS running and issuing the appropriate shell commands to retrieve the details. Its a lot easier if you have an all-in-one kind of situation...just issue local shell commands. lol

-J

Go ahead and issue pull requests I don't mind the help. I'm extraordinarily busy with work right now, I'm hoping to jump back into the code this weekend. I also just completely wiped and started from scratch on my main machine, so I'm getting all my crap reinstalled.