PlexWatch Installation

Status
Not open for further replies.

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
So I've been enjoying my configuration so far with Plex running, and looking to take the next step to get some more info from my Plex instance. I'm trying to setup PlexWatch and the instructions have worked pretty flawlessly up until getting the Perl modules installed. I'm a BSD newb and not familiar as I should be with programming in general. That said, I'm trying to force myself through the learning curve in getting this done. The dev laid out great instructions that I've been successful with in a Linux enviro, but I'd like to get this working on my FreeNAS box.

Is anyone able to help out in how I can get through installing the necessary modules as listed by the dev in the installation seen here? Any help in getting through this would be wonderful!!

PlexWatch - https://github.com/ljunkie/plexWatch
Install Perl requirements
  • Debian/Ubuntu - apt-get
sudo apt-get install libwww-perl

sudo apt-get install libxml-simple-perl

sudo apt-get install libtime-duration-perl

sudo apt-get install libtime-modules-perl

sudo apt-get install libdbd-sqlite3-perl

sudo apt-get install perl-doc

sudo apt-get install libjson-perl
 
D

dlavigne

Guest
I'm assuming you're looking for the FreeBSD pkg equivalents? If so, Freshports.org is your friend.

In FreeBSD, perl modules start with p5. So, search for libwww at freshports.org and you'll see there is a p5-libwww (that's the one you want).

Search for libmxl-simple, and you'll see there is a p5-XML-LibXML-Simple. And so on through your list of needed modules.

Most perl modules have been ported as FreeBSD packages. If you ever run across one that hasn't, use cpan to install the module. This method works but isn't recommended unless needed, as the installation won't appear in pkg info.
 

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
dlavigne - thank you for the info. I'm glad someone can help here. I'm actually just starting to understand that BSD is not Linux (which my foolish self had thought previously!). This makes sense why there are all these "ports" of things.

Now that said, how would one go about installing these ports or pulling these ports down? I know in Linux obviously things like Yum/Apt-get exist. What is the equivalent in BSD? I'm seeing you mention checking our Freshports.org to find the packages, what would be the process for installing such a package?

And is P5 the preface for the Perl modules due to the current version being 5.x? Or is this just something that is more difficult to describe than is worth?
 

Pouper

Dabbler
Joined
Jan 15, 2014
Messages
43
This info is in the manual and wiki for freenas under installing non pbi packages. Pkg install is the cmd needed
 

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
Pouper - thanks for the direction. I'll dive in and get learning. :)
 

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
Ok folks, you are lifesavers. This is awesome, I've now got this badboy running efficiently. Going to post some followup detail in case anyone else happens upon this problem and needs some nudging in the right direction.

Installing non-PBI Software - Freenas - location for folks unaware like me of BSD and install process, good info here

Libraries that I used to get this working in my Jail:
Code:
pkg install p5-libwww
pkg install p5-XML-Simple
pkg install p5-Time-Duration
pkg install p5-Time-modules
pkg install p5-DBD-SQLite
pkg install p5-JSON


Outside that using PushOver for notifications, I got an error around HTTPS, so I had to add in the HTTPS module using:
Code:
cpan
install LWP::Protocol::https


After this, the instructions on the GitHub page all worked fine. I was able to test successfully, and I was able to add to crontab as needed. Next project, getting PlexWatchWeb to work for a web interface. This should hopefully go onto my Plex jail and both rest comfortably in there.
 

benamira

Explorer
Joined
Oct 12, 2011
Messages
61
I have succesfully installed inside the Plex plugin Jail.
But no success getting into cron. Could you explained how you make it work??

Also any progress with plexwatchWeb??


thanks
 

mrMuppet

Contributor
Joined
Mar 14, 2014
Messages
192
Hey benamira, or shmixx! Can you post any guide how you did install plexwatch? Thanks!
 

benamira

Explorer
Joined
Oct 12, 2011
Messages
61
i have just followed the instruction in github page.
Then when coming to Perl requirements, followed the post above by shmixx.

The only issue is i haven't been able to "cron" it, so for the moment it is useless for me.
As this only makes sense if it runs every minute. :confused:
 

mrMuppet

Contributor
Joined
Mar 14, 2014
Messages
192

benamira

Explorer
Joined
Oct 12, 2011
Messages
61
i made it work. Just reading a bit.
my wrong crontab was
* * * * * root /opt/plexWatch/plexWatch.pl

I change to
* * * * * /opt/plexWatch/plexWatch.pl

And now it is working. So deleting the user.

I have also set up plexwatchWeb in separate machine, Mac OS + MAMP, and works like a charm.
Next step should be run plexwatchWeb also in freenas. Lets see.
 

nitefood

Dabbler
Joined
May 1, 2014
Messages
10
Hi all,

this looks pretty much the only thread where installing plexWatch/plexWatchWeb on FreeNAS is discussed, so I thought i'd chime in first of all to say thanks to you guys for the useful info, and secondly to share the steps I took to install the Apache web server and plexWatchWeb on a FreeNAS jail, just in case someone is stuck on that. I'm using FreeNAS 9.2.1.5.

As a side note, I installed plexWatch and plexWatchWeb on a separate jail rather than adding on the Plex jail, mostly because I wanted to avoid risking any configuration loss in case of a Plex plugin update. This way, the jail is isolated and only "connects" to the Plex install by means of a mapped storage directory, namely the Plex logs dir ([your_storage_dir]/jails/plexmediaserver_1/usr/pbi/plexmediaserver-amd64/plexdata/Plex Media Server/Logs), which is readable from the "plexWatch" jail and is mapped read-only for plexWatch.pl to do its log parsing tasks.

  1. From the shell, enter the jail:
    jls
    jexec <jail_id> csh
  2. Install the webserver (I decided to use Apache) alongside mod_php support and php5:
    pkg install apache22 mod_php5 php5-sqlite3 php5-curl php5-json php5-extensions
  3. Adjust your Apache conf to enable handling of php pages on your webserver. Start by editing your httpd.conf:
    nano /usr/local/etc/apache22/httpd.conf
    adjust your DirectoryIndex directive:
    DirectoryIndex index.html index.php
    and add these two lines to your configuration, inside the <IfModule mime_module> block:
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
  4. At this point you need to make sure php correctly reports your time zone, otherwise you'll get wrong timestamps in plexWatchWeb. Start by initializing php.ini from the default production values supplied with the package:
    cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
    then edit it:
    nano /usr/local/etc/php.ini
    and look for a commented out ";date.timezone=" line. Remove the ";" and change it to your actual time zone (a list of supported TZs is here), in my case:
    date.timezone = Europe/Rome
  5. Download plexWatchWeb to your webroot, unpack and fix its permissions:
    cd /usr/local/www/apache22/data
    wget --no-check-certificate https://github.com/ecleese/plexWatchWeb/archive/master.zip
    unzip master.zip && rm master.zip
    mv plexWatchWeb-master plexWatch
    chown -R www:www plexWatch
  6. Enable Apache to start up by editing /etc/rc.conf and appending the following line at the end:
    apache22_enable="YES"
  7. Restart Apache:
    service apache22 restart
After performing these steps, you should be able to reach your plexWatchWeb install by opening http://<ip_of_your_jail>/plexWatch in your web browser.

Have fun!
 

ThomasDK81

Dabbler
Joined
Mar 19, 2012
Messages
49
Any reason why you didn't use a ubuntu or centos jail and just follow the instructions?
 

nitefood

Dabbler
Joined
May 1, 2014
Messages
10
I didn't want to fork a whole new subsystem just for plexwatch, I have other servers for that. I wanted to keep it FreeBSD, and just needed an apache+php install. A simple pluginjail with as little additional packages as possible seemed to me the most lightweight way of accomplishing it.
Bear in mind I don't run FreeNAS on a very powerful system, so every little bit helps.

Beside that, I love style exercises.
 

Fattrain

Dabbler
Joined
Jul 22, 2013
Messages
23
THANK YOU for this thread guys!!! I have bookmarked it and plan on attempting this installation in the next week or so. Being a FreeBSD newb this will really help me out!
 

Fattrain

Dabbler
Joined
Jul 22, 2013
Messages
23
So following nitefoods guide above I have got apache installed and plexwatch running despite having to use "vi" as the txt editor instead, however now I have a weird problem...

When I go into plexWatch settings wrench button it will show the version number in the middle with the general tab highlighted on the left however it doesn't do anything when clicking on the tabs on the left (PMS & Database, Plex Authentication, Grouping).

I can see it changing in the address bar (http://172.25.12.4/plexWatch/settings.php#pms) but the page remains statically the same so I can't edit any settings ??
 

Fattrain

Dabbler
Joined
Jul 22, 2013
Messages
23
*FIXED*

Just in case anyone else comes across this same problem you can fix your broken PlexWatch settings by simply deleting the generated config.php file under the /config folder and then refresh the settings page to start the new setup wizard again.
 

Fattrain

Dabbler
Joined
Jul 22, 2013
Messages
23
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
 

BrianDMG

Explorer
Joined
Jan 19, 2013
Messages
70
Libraries that I used to get this working in my Jail:
Code:
pkg install p5-libwww
pkg install p5-XML-Simple
pkg install p5-Time-Duration
pkg install p5-Time-modules
pkg install p5-DBD-SQLite
pkg install p5-JSON

For some reason, when I try to install these packages, I'm getting the following error(s):
Code:
root@PlexWatch:/ # pkg install p5-libwww
Updating repository catalogue
pkg: pkg+http://pkg.FreeBSD.org/freebsd:9:x86:64/latest/digests.txz: Invalid URL scheme
pkg: No digest falling back on legacy catalog format
pkg: pkg+http://pkg.FreeBSD.org/freebsd:9:x86:64/latest/repo.txz: Invalid URL scheme


Any ideas? Am I doing something wrong? I created this as a "standard" jail, by the way.
 

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
I would suggest installing a plugin jail for this. I'm not sure what is different in the Standard jail type, but it definitely makes things more difficult. By more difficult, I mean for me being a non-FreeBSD user, none of the "how-to" or "follow this" type guides worked when it came to packages and ports. I tried to stand up a Standard jail to install an app for home automation called OpenHAB, and had all sorts of nightmares getting the pkg app to update and install ports/packages, etc. I switched to a plugin jail, and had no issues whatsoever, it all worked fine.

My suggestion - switch to a plugin jail.
 
Status
Not open for further replies.
Top