PlexWatch Installation

Status
Not open for further replies.

nitefood

Dabbler
Joined
May 1, 2014
Messages
10
So this is a whole new problem. Are you sure you didn't get a device in your local LAN assigned that IP by mistake from DHCP? Up&Down connectivity perfectly fits the IP address collision scenario.
What happens if you change IP address on the jail? Or even better, have you tried creating a fresh new plugin jail, assign it a different IP address, and verify if it has solid connectivity? What if you shut down the troubled jail and try ping'ing its ip address, just to make sure it hasn't been assigned to another device in your network?
 

BrianDMG

Explorer
Joined
Jan 19, 2013
Messages
70
Well, I feel like an idiot. The thought had occurred to me that I might have some sort of IP conflict going on, but I figured the chances of that actually being the case were slim. However, due to some dusty DHCP reservations, that jail was indeed being assigned a conflicting IP. Problem fixed now, pWw seems to be loading on human timescales now (imagine that). I'll keep an eye on the error log and see if it calms down. Thanks for the dose of humble pie :)
 

nitefood

Dabbler
Joined
May 1, 2014
Messages
10
Glad you had it sorted out :)
I would play safe and redo the jail setup from scratch, in order to avoid any possible problems that might have been caused by earlier network issues while installing packages and dependencies...


Inviato dal mio iPhone utilizzando Tapatalk
 

Fattrain

Dabbler
Joined
Jul 22, 2013
Messages
23
I have pretty much followed Nitefoods original guide (substituting apache22 for apache24) and then sprinkled in a few tidbits from BrianDMG but now I am officially stumped.

I can reach my PlexWatchWeb main page but it just has an orange box in the middle saying php5-sqlite is not installed. I tried doing pkg install php5-sqlite3 command and it says it's already installed.

Here is my apache log and there is an obvious error with the sqlite modules but I just can't figure what to do next. FreeBSD newbie here and can really use some guidance. Thanks guys!

Apache httpd-error.log below after doing a "service apache24 restart" command:

Code:
[Mon Dec 01 14:21:13.396086 2014] [mpm_prefork:notice] [pid 8169] AH00169: caught SIGTERM, shutting down
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20100525/pdo_sqlite.so' - Shared object "libsqlite3.so.0" not found, required by "pdo_sqlite.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20100525/sqlite3.so' - Shared object "libsqlite3.so.0" not found, required by "sqlite3.so" in Unknown on line 0
[Mon Dec 01 14:21:13.583764 2014] [mpm_prefork:notice] [pid 76511] AH00163: Apache/2.4.10 (FreeBSD) PHP/5.4.35 configured -- resuming normal operations
[Mon Dec 01 14:21:13.583839 2014] [core:notice] [pid 76511] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Mon Dec 01 14:21:26.838361 2014] [:error] [pid 76512] [client 172.20.24.42:50277] PHP Notice:  Undefined variable: plexWatch in /usr/local/www/apache24/data/plexWatch/index.php on line 73
[Mon Dec 01 14:21:26.838635 2014] [:error] [pid 76512] [client 172.20.24.42:50277] PHP Notice:  Undefined variable: plexWatch in /usr/local/www/apache24/data/plexWatch/index.php on line 75
[Mon Dec 01 14:21:26.838721 2014] [:error] [pid 76512] [client 172.20.24.42:50277] PHP Notice:  Undefined variable: plexWatchPmsUrl in /usr/local/www/apache24/data/plexWatch/index.php on line 88
[Mon Dec 01 14:21:26.838971 2014] [:error] [pid 76512] [client 172.20.24.42:50277] PHP Warning:  file_get_contents(/status/sessions?X-Plex-Token=): failed to open stream: No such file or directory in /usr/local/www/apache24/data/plexWatch/index.php on line 88
[Mon Dec 01 14:21:26.839080 2014] [:error] [pid 76512] [client 172.20.24.42:50277] PHP Notice:  Undefined variable: plexWatchPmsUrl in /usr/local/www/apache24/data/plexWatch/index.php on line 91
[Mon Dec 01 14:21:26.839647 2014] [:error] [pid 76512] [client 172.20.24.42:50277] PHP Warning:  simplexml_load_file(): I/O warning : failed to load external entity "/library/sections" in /usr/local/www/apache24/data/plexWatch/index.php on line 91
 
Joined
Mar 6, 2014
Messages
686
Just curious: Did you manage to resolve this issue?

In general: Is PlexWatch worth the hassle?
 

EvanVanVan

Patron
Joined
Feb 1, 2014
Messages
211
This thread was a lot of help getting PlexWatch and PW/web working, but it still took me a while. I want to add this link with a complete tutorial for installing PlexWatch to a seperate jail. It's as simple as copying/pasting in order.

http://forums.nas4free.org/viewtopic.php?f=79&t=7891&sid=af7225281bedea429d757f421c84aaa3

The only part that I got hung up on for a little while and want to clarify was the section about logging IPs. (It's really very simple I'm just a FreeNAS/linux noob.) I hid my clarification to clean up this post.
Bonus Round 2
If you like to log IP addresses (I do -- call me old-fashioned), you need to add an additional package:
Code:
pkg install p5-File-ReadBackwards

You also have to enable debug logging in PMS, map your PMS Log folder (fstab) to your plexWatch jail and edit your config.pl again:
Code:
nano /opt/plexWatch/config.pl

$server_log = '/mnt/Your_plexdata_directory/Plex Media Server/Logs/Plex Media Server.log';
$log_client_ip = 1;
$debug_logging = 1;

Your $server_log directory is in whatever jail you installed PMS to, in /usr/local/plexdata/Plex Media Server/Logs/Plex Media Server.log by default. Again, you need access from this jail, if separate, to these folders in your PMS jail (if applicable) by properly configuring fstab (there is a handy form in the webgui for this in The Brig).

It should look something like this:
Code:
/mnt/plex_jail/usr/local/plexdata/ /mnt/plexWatch_jail/mnt/plexlogs/ nullfs ro 0 0;

First, in the FreeNAS GUI, select the PlexWatch jail and Add Storage. Like the last bit of code there, set the source directory to be your actual plex data folder, and the destination directory to be in the /mnt/plexlogs folder(create it if necessary) in the current PlexWatch jail. And select the storage as Read Only.

Next open and edit the config.pl script (the first bit of code) and change variables like shown. For the $server_log the value should be the location in the current PlexWatch jail which in this case would be: '/mnt/plexlogs/PlexPlex Media Server/Logs/Plex Media Server.log'. (This file path is what took me the longest to set correctly). It also seemed like it only worked when I removed all the returns and made the entire "$server_log" one long line.

Finally save the file and along with the rest of the instructions you should have a fully working PW installation with IP logging.

With one of the first few commands I got this error:
"Shared object "libiconv.so.2" not found, required by "wget""

following this post: https://forums.freenas.org/index.php?threads/pkg-doesnt-work-anymore-in-9-3-jails.26550/#post-168700 fixed it for me (in case anyone else gets the same error). Also, the commands in that post worked perfectly. I had initially tried the commands in the last post of that thread and it fixed the first error, but I got stuck with another one.
 
Last edited:

Muddro

Explorer
Joined
Oct 6, 2014
Messages
59
Alright guys so I'm back, still working on this. I have gotten it to access my Plex server (as it can see total videos e.t.c.) but I still cannot access the actual Database to store the information?? Screenshot below. Any help would be much appreciated.

I do believe the database is located in the correct location - /opt/plexWatch/plexWatch.db (inside my apache server jail) but I still get the following error message. I even did a chmod 777 to make sure that the plexWatch.db had read/write access e.t.c.

y97EGA8.png

Did anyone find a solution for this? I just installed and everything is working great accept for the failed to access messages and on the charts tab all the images are broken.

EDIT: NM, it was caused by having the Use HTTPS (optional) check box marked.
 
Last edited:

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231

Wolfeman0101

Patron
Joined
Jun 14, 2012
Messages
428
This thread was a lot of help getting PlexWatch and PW/web working, but it still took me a while. I want to add this link with a complete tutorial for installing PlexWatch to a seperate jail. It's as simple as copying/pasting in order.

http://forums.nas4free.org/viewtopic.php?f=79&t=7891&sid=af7225281bedea429d757f421c84aaa3
I'm following this guide and everything is good until step 7. When I try to test the script I get this. Any ideas?

Code:
root@PlexWatch:/opt/plexWatch # /opt/plexWatch/plexWatch.pl
Can't locate IO/Socket/SSL.pm in @INC (you may need to install the IO::Socket::SSL module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.18 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.18/mach /usr/local/lib/perl5/5.18 /usr/local/lib/perl5/site_perl/5.18 /usr/local/lib/perl5/site_perl/5.18/mach .) at /opt/plexWatch/plexWatch.pl line 31.
BEGIN failed--compilation aborted at /opt/plexWatch/plexWatch.pl line 31.


OK I fixed that error by installing these 3 packages.
Code:
pkg install p5-IO-Socket-SSL p5-Net-SSLeay p5-Crypt-SSLeay
 
Last edited:

Wolfeman0101

Patron
Joined
Jun 14, 2012
Messages
428
I guess I should've read the whole guide but whatever I got it working. One thing is even though it said the repository was up to date it wasn't getting the right version of PHP.

Code:
pkg update --force


That fixed it.
 

Wolfeman0101

Patron
Joined
Jun 14, 2012
Messages
428
Does anyone know how I can add authentication to plexWatch/Web? I don't want the world able to see my viewing habits.
 

EvanVanVan

Patron
Joined
Feb 1, 2014
Messages
211
Does anyone know how I can add authentication to plexWatch/Web? I don't want the world able to see my viewing habits.

Did you install plexWatch and PW/Web in a separate jail than your Plex server? Just don't forward the ports to that jail. I think both the creators of plexWatch and plexWatch/Web specifically recommend you don't make them accessible from outside your LAN for that exact reason you pointed out. And in case you entered your plex pass username/password in to PW/web it's safe.
 

Wolfeman0101

Patron
Joined
Jun 14, 2012
Messages
428
Did you install plexWatch and PW/Web in a separate jail than your Plex server? Just don't forward the ports to that jail. I think both the creators of plexWatch and plexWatch/Web specifically recommend you don't make them accessible from outside your LAN for that exact reason you pointed out. And in case you entered your plex pass username/password in to PW/web it's safe.
Yeah I made a separate jail. I guess I can just keep it internal but it's just apache and I know you can add authentication. I just don't know apache.
 

AstroZombie

Explorer
Joined
Jul 20, 2014
Messages
76
This thread was a lot of help getting PlexWatch and PW/web working, but it still took me a while. I want to add this link with a complete tutorial for installing PlexWatch to a seperate jail. It's as simple as copying/pasting in order.

http://forums.nas4free.org/viewtopic.php?f=79&t=7891&sid=af7225281bedea429d757f421c84aaa3

The only part that I got hung up on for a little while and want to clarify was the section about logging IPs. (It's really very simple I'm just a FreeNAS/linux noob.) I hid my clarification to clean up this post.
First, in the FreeNAS GUI, select the PlexWatch jail and Add Storage. Like the last bit of code there, set the source directory to be your actual plex data folder, and the destination directory to be in the /mnt/plexlogs folder(create it if necessary) in the current PlexWatch jail. And select the storage as Read Only.

Next open and edit the config.pl script (the first bit of code) and change variables like shown. For the $server_log the value should be the location in the current PlexWatch jail which in this case would be: '/mnt/plexlogs/PlexPlex Media Server/Logs/Plex Media Server.log'. (This file path is what took me the longest to set correctly). It also seemed like it only worked when I removed all the returns and made the entire "$server_log" one long line.

Finally save the file and along with the rest of the instructions you should have a fully working PW installation with IP logging.

With one of the first few commands I got this error:
"Shared object "libiconv.so.2" not found, required by "wget""

following this post: https://forums.freenas.org/index.php?threads/pkg-doesnt-work-anymore-in-9-3-jails.26550/#post-168700 fixed it for me (in case anyone else gets the same error). Also, the commands in that post worked perfectly. I had initially tried the commands in the last post of that thread and it fixed the first error, but I got stuck with another one.

Followed the above upto testing the script quite easily what have I done wrong here?

jKtZovR.png
 

EvanVanVan

Patron
Joined
Feb 1, 2014
Messages
211
Followed the above upto testing the script quite easily what have I done wrong here?
Sorry man, when I quoted the nas4free.org site regarding "IP Logging" I missed the first command so if you just followed my quote you may have missed it as well. I edited my post to fix it.

Did you run this command? The error says you're missing the File/ReadBackwards.pm
Code:
pkg install p5-File-ReadBackwards


I'm also not 100% sure that "/mnt/mainvolume/pluginjails/plexmediaserver_1/var/db/..." path is correct. Did you add the storage to that specific jail? I think it should look like "/mnt/plexmediaserver_1/..." without the "/mainvolume/pluginjails/" part.
 

Krowvin

Explorer
Joined
Jul 24, 2014
Messages
60
Added bonus:

If you want Apache to redirect your local IP to the subdirectory /plexWatch here's the code snippet. Figured it might save someone from having to search.
for example 192.168.1.55 to 192.168.1.55/plexWatch

It's important to note that I have plexWatch in it's own jail with a dedicated local IP.

1.
Navigate to
Code:
nano /usr/local/etc/apache24/httpd.conf

2. Add these lines of code to the top of your httpd.conf file
Code:
<VirtualHost *>
RedirectMatch ^/$ /plexWatch/
</VirtualHost>

3. ctrl+x to save and exit the file
 

AstroZombie

Explorer
Joined
Jul 20, 2014
Messages
76
Code:
root@plexwatch:/ # /opt/plexWatch/plexWatch.pl                                 
500 Can't connect to my.plexapp.com:443                                         
Content-Type: text/plain                                                       
Client-Date: Mon, 05 Sep 2016 20:57:17 GMT                                     
Client-Warning: Internal response                                               
                                                                               
Can't connect to my.plexapp.com:443                                             
                                                                               
hostname nor servname provided, or not known at /usr/local/lib/perl5/site_perl/L
WP/Protocol/http.pm line 47.                                                   
Can't connect to my.plexapp.com:443                                             
                                                                               
hostname nor servname provided, or not known at /usr/local/lib/perl5/site_perl/L
WP/Protocol/http.pm line 47.                                                   
        ...propagated at /opt/plexWatch/plexWatch.pl line 3814.


Any ideas?
 

EvanVanVan

Patron
Joined
Feb 1, 2014
Messages
211
Any ideas?

Yes, in all seriousness delete the whole PlexWatch installation and install Plexpy instead lol. The entire process is much simpler and it auto updates too. Does the same thing as PlexWatch but with more features.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I suspect the security changes from 1.1.0 have broken this, along with PlexEmail for anyone using that.

PlexPy is a much better solution for PlexWatch though and uses a token to authenticate with your PMS so still works perfectly. It also has lots of notifications that I might think if using to replace PlexEmail.

You can even import your PlexWatch database if you wanted to keep all the history!

I do wish Plex Inc. would stop trying to force anything connecting to a PMS to be logged into Plex.tv though :(
 
Last edited:
Status
Not open for further replies.
Top