plexSentry (20160511 Update)

Can you open source the code so others (aka me) can help? Would be nice to see if we could get a friendlier install for the less technically inclined. I’m installing it myself as we speak, Comcasts announcement today about expanding data caps has be a bit worried they’ll move to my city at some point, and I need to get this configured and running to prevent that.

EDIT: Even I caved at the instructions :stuck_out_tongue: Couldn’t get IIS and the UI working properly. Maybe I’ll implement this in a more cross-platform friendly python or something. Interested in collaborating on it? We could pull @cayars in and do the firewall stuff too.

@vanstinator said:

EDIT: Even I caved at the instructions :stuck_out_tongue: Couldn’t get IIS and the UI working properly. Maybe I’ll implement this in a more cross-platform friendly python or something. Interested in collaborating on it? We could pull @cayars in and do the firewall stuff too.

Please do… The concept is fantastic, however the install and use need to be much more user friendly. Since it’s beginnings that has been the ‘issue’…

https://forums.plex.tv/discussion/comment/831767/#Comment_831767

This is not knocking the software, because it does attempt to fill a void that Plex themselves are failing on…

https://forums.plex.tv/discussion/80857/popular-server-side-speed-limits-caps-for-shared-subscribed-users

I’ve finally got past setting up IIS and getting most of the settings corrected, but now I’m stuck at the following error.

I am using SQL lite on w2k8 r2 with IIS.
Using the url localhost/index-sqlite.aspx
- Media page - “Processing has failed”
- User Page - Trying to update - update has failed.

I finally got this to work. However I can’t get the thumbs to show up or the kill session to work. I used sql express and IIS on a windows 7 box. The plex machine on the same network is on a linux box. I think this might be the reason. But I am not sure a way around this. I noticed that to pull thumbs it keeps going for my external address with doesn’t include the port unless I specify it in the script-Plex-common.js.

So I managed to get it to work (kinda). The gui acts real odd and stuff didn’t always populate. I managed to configure the settings directly in the database. Now I’m running into an issue with orphan streams. It seems that Android devices and Chromecast are viewed as orphans and gets killed as soon as the app detects it. Does anyone else have this issue?

@xxrazorxx said:
So I managed to get it to work (kinda). The gui acts real odd and stuff didn’t always populate. I managed to configure the settings directly in the database. Now I’m running into an issue with orphan streams. It seems that Android devices and Chromecast are viewed as orphans and gets killed as soon as the app detects it. Does anyone else have this issue?

I noticed this also last night while testing that it was killing my Android device a few seconds after I started to watch something. So I had to shut it down. Till I can find an answer to it and the other questions.

Huh, that’s weird considering that I’m a Android user and I put in the orphan streams feature because of Apple devices. If you had to configure things directly in the database, it probably means that it’s not grabbing info automatically and that’s causing issues later. I’ll put together a version with a log file option this weekend and we’ll get to the bottom of this.

@random.server said:
Huh, that’s weird considering that I’m a Android user and I put in the orphan streams feature because of Apple devices. If you had to configure things directly in the database, it probably means that it’s not grabbing info automatically and that’s causing issues later. I’ll put together a version with a log file option this weekend and we’ll get to the bottom of this.

Any chance the logging can help with why I can’t use the kill session option?

@jskala said:

@random.server said:
Huh, that’s weird considering that I’m a Android user and I put in the orphan streams feature because of Apple devices. If you had to configure things directly in the database, it probably means that it’s not grabbing info automatically and that’s causing issues later. I’ll put together a version with a log file option this weekend and we’ll get to the bottom of this.

Any chance the logging can help with why I can’t use the kill session option?

probably because you didn’t set the server address in the javascript file. The reason it’s there is so that I could get around my proxy. In hindsight, it’d have been a better idea to have the middle man take care of it. ■■■■. I’ll have to change that.

@random.server said:

@jskala said:

@random.server said:
Huh, that’s weird considering that I’m a Android user and I put in the orphan streams feature because of Apple devices. If you had to configure things directly in the database, it probably means that it’s not grabbing info automatically and that’s causing issues later. I’ll put together a version with a log file option this weekend and we’ll get to the bottom of this.

Any chance the logging can help with why I can’t use the kill session option?

probably because you didn’t set the server address in the javascript file. The reason it’s there is so that I could get around my proxy. In hindsight, it’d have been a better idea to have the middle man take care of it. ■■■■. I’ll have to change that.

If you’re referring to the script-plex-common.js yes i have my external address and internal one.

I have the JavaScript filled out as well.

@jskala @xxrazorxx
You don’t have a backslash on the end do you? Here’s the thing, if it can’t get thumbnails, the javascript portion isn’t communicating with your server. If you go into the “Plex Links” from from the menu and select “Server - Media Sessions”, you’ll see if it’s actually working. However, like i mentioned before, I use a proxy and overlooked how i originally intended it to be used…

server_address_external came first, most people will need to set it up as http://server:port or https://server:port (because of my proxy, i use https://server). Later when I added the kill feature, i added server_address_internal and server_address_internal_port because the combination of those two get sent to the middleman (forgot that’s how it worked till just now), which then kills the task from within the local network (and gets around proxies). I should have kept it as the same style as server_address_external .

However if your webserver is on a different network from your plex server, then it’s all external addresses

@random.server said:
@jskala @xxrazorxx
You don’t have a backslash on the end do you? Here’s the thing, if it can’t get thumbnails, the javascript portion isn’t communicating with your server. If you go into the “Plex Links” from from the menu and select “Server - Media Sessions”, you’ll see if it’s actually working. However, like i mentioned before, I use a proxy and overlooked how i originally intended it to be used…

server_address_external came first, most people will need to set it up as http://server:port or https://server:port (because of my proxy, i use https://server). Later when I added the kill feature, i added server_address_internal and server_address_internal_port because the combination of those two get sent to the middleman (forgot that’s how it worked till just now), which then kills the task from within the local network (and gets around proxies). I should have kept it as the same style as server_address_external .

However if your webserver is on a different network from your plex server, then it’s all external addresses

I realized when looking at the code it was calling external and I am only using it internal. So I did this
var server_address_external = “http://192.168.2.30:32400”//external address of server
var server_address_internal = “http://192.168.2.30”//external address of server
var server_address_internal_port = “32400” //external address of server

And that worked I get thumbs and I get to kill the session. Have you put the new version up to log for why android is being killed?.

Here is what I have

var server_address_external = “http://myiphere:32400”//external address of server
var server_address_internal = “http://192.168.1.9”//external address of server
var server_address_internal_port = “32400” //external address of server

And its real odd. I get 0 info about users and everything else, if I look at the database I can see info.

@xxrazorxx said:
Here is what I have

var server_address_external = “http://myiphere:32400”//external address of server
var server_address_internal = “http://192.168.1.9”//external address of server
var server_address_internal_port = “32400” //external address of server

And its real odd. I get 0 info about users and everything else, if I look at the database I can see info.

I see you are using Chrome. If you hit F12 you will get the dev console and can get some insight on what is going wrong. Make sure you are playing something while doing this. And Hit F12 then network tab at top refresh and you can see what is failing. Might just be your database connection string in the database.plex.aspx file.

@random.server

Here is the error when it kills and android.
I also noticed that when it was playing for the time before the kill, It didn’t have the option to kill that android session. Said N/A

2015-12-12 16:47:45- Checking current syncs
Current Syncs -: 0
Synced Items -: 0
Checking for removed syncs
Removed Syncs -: 0
Checking for orphaned transcode sessions
Current sessions (sync and play) -: 1
Found orphaned transcoding session (ID -: 64f503febf8a0d00-com-plexapp-android)
Attempting to shutdown trying to shutdown 64f503febf8a0d00-com-plexapp-android
2015-12-12 16:47:45- Starting timer to check status at a interval of 5 seconds
Accessing user list from database
Checking for currently connected clients
Connected clients-: 1
Checking for currently playing sessions
Current sessions-: 0
Checking for previous sessions
Previous Sessions -: 0

I do appear to have a bad connection string, can someone give me an example of what they have?

@xxrazorxx said:
I do appear to have a bad connection string, can someone give me an example of what they have?

What are you using for database. I am using SQL express I can copy mine when I get home

I’m using sql express as well. Thanks!

@xxrazorxx said:
I’m using sql express as well. Thanks!

Here is what I am using fill in the values for you. IE server, username, and password.
“Data Source=SERVER\SQLEXPRESS;Initial Catalog=PlexSentry;Persist Security Info=True;User ID=USERNAME;Password=PASSWORD”;