Tautulli
Tautulli is a python based web application for monitoring, analytics, and notifications for Plex Media Server. It includes the following features:
- Responsive web design viewable on desktop, tablet, and mobile web browsers.
- Themed to complement Plex/Web.
- Easy configuration setup (no separate web server required).
- Monitor current Plex Media Server activity.
- Fully customizable notifications for stream activity and recently added media.
- Top statistics on the home page with configurable duration and measurement metrics.
- Global watching history with search/filtering & dynamic column sorting.
- Full user list with general information and comparison stats.
- Individual user information, including devices IP addresses.
- Complete library statistics and media file information.
- Rich analytics presented using Highcharts graphing.
- Beautiful content information pages.
- Full sync list data on all users syncing items from your library.
For more information, visit this link.
This section gives you an overview of Tautulli's Initial Setup Wizard and the relevant settings you may be interested in. This assumes the following:
- You have a fully configured Plex Media Server
Add Plex Media Server to your Tautulli Instance
- Go to
Settings -> Plex Media Server
- Follow these steps:
- Click on
Fetch New Token
. A new browser window will open. Login to your Plex account to authenticate with Plex. - Enter
Plex IP Address or Hostname
:172.17.0.1
- Enter
Plex Port
:{The Plex port as given in your Control Panel}
- Click on
Verify Server
.
- Click on
- Finally, Save all the settings.
- Screenshot for reference:
Installing and Configuring Custom Tautulli Scripts
This guide will show you how to set up Custom Tautulli Scripts. These scripts extend the functionality of your Plex Media Server and give you more flexibility
In this guide, we'll be installing 2 scripts, killstream.py
and limiterr.py
from blacktwin's JBOPS repository.. We'll be setting up the following:
-
killstream.py
to disallow transcoding of 4k sources -
limiterr.py
to limit the number of plays of a show during nighttime.
::: info Note that the scripts in this guide require Plex Pass and will only work on Plex Pass users. :::
Prerequisites
- Login to your slot's SSH
- We'll create a folder named
scripts
, so domkdir -p scripts
then navigate to your newly created folder withcd scripts
- Get the full path of the folder by doing
pwd
. Take note of the output. In this guide, the output is/home7/usbdocs/scripts
. Yours may vary.
usbdocs@lw975:~$ mkdir -p scripts
usbdocs@lw975:~$ cd scripts
usbdocs@lw975:~/scripts$ pwd
/home7/usbdocs/scripts
usbdocs@lw975:~/scripts$
killstream.py
Downloading The Script
- Download the latest revision of the Script below using
wget
wget https://raw.githubusercontent.com/blacktwin/JBOPS/master/killstream/kill_stream.py
- After that, change the owner and make it executable by running the following commands
chown $USER:$USER kill_stream.py
chmod a+x kill_stream.py
Configuring Tautulli Notification Agent
- Open up Tautulli and go to Settings (Cog Icon top-right hand corner)
- Then, on Notification Agents, click Add a new notification agent. Scroll down and select Script.
- Then under Script Settings, enter the following information
Configuration
Script Folder: [output of `pwd`]
Script file: ./kill_stream.py
Description: [Add anything here.]
Triggers
Playback Start
Transcode Decision Change
Conditions
Condition {1}: Video Decision - is - transcode
Condition {2}: Library Name - contains - 4K
Append 4k Library Name with 4k movies/TV Shows in Plex for the second condition to work.
Arguments
Playback Start:
--jbop stream --username {username} --sessionId {session_id} --killMessage 'Please do not transcode 4k. Thanks!'
Arguments
Transcode Decision Change:
--jbop stream --username {username} --sessionId {session_id} --killMessage 'Please do not transcode 4k. Thanks!'
- Once that's all done, click Save
Testing The Script
- You can test your Script by attempting to play a 4k file and change the quality to 720p or lower. It'll transcode for a while, after which you should get the stream kill message.
limiterr.py
::: info This Script is dependent on the timezone of Plex instances. Our slots are hosted in The Netherlands, so its timezone is CET/CEST. Adjust the times as necessary. You may use World Time Buddy to check your local timezone with the slot's timezone. :::
Downloading The Script
- Download the latest revision of the Script below using
wget
wget https://raw.githubusercontent.com/blacktwin/JBOPS/master/killstream/limiterr.py
- After that, change the owner and make it executable by running the following commands
chown $USER:$USER limiterr.py
chmod a+x limiterr.py
Configuring Tautulli Notification Agent
- Open up Tautulli and go to Settings
- Then, on Notification Agents, click Add a new notification agent. Scroll down and select Script.
- Then under Script Settings, enter the following information
Configuration
Script Folder: [output of `pwd`]
Script file: ./limiterr.py
Description: [Add anything here.]
Triggers
Playback Start
Conditions
Condition {1}: Current Hour - is - 22 or 23 or 0 or 1
(Value is dependent on your timezone and the slot's timezone.)
Arguments
Playback Start:
--jbop limit --username {username} --sessionId {session_id} --grandparent_rating_key {grandparent_rating_key} --limit plays=3 --delay 60 --killMessage "You sleep bro?"
- Once that's all done, click Save
Testing The Script
- You can test your Script by watching some shows at the set times. After 3 plays, you should get the stream kill message.