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.
Prerequisites
- You have a fully configured Plex Media Server.
Add Plex Media Server to your Tautulli Instance
- Go to 1 Settings.
- Select 2 Plex Media Center.
- Follow these steps:
- 1 Fetch New Token. A new browser window will open. Login to your Plex account to authenticate with Plex.
- 2 Plex IP Address or Hostname:
172.17.0.1
- 3 Plex Port:
{The Plex port as given on your UCP}
- 4 Verify Server.
- 5 Save.
Custom Scripts
This guide will show you how to set up custom scripts with Tautulli. These scripts extend the functionality of your Plex Media Server and give you more flexibility.
We will be installing two scripts, killstream.py
and limiterr.py
from blacktwin's JBOPS repository.
killstream.py
: to disallow transcoding of 4k sources.limiterr.py
: to limit the number of plays of a show during nighttime.
Instructions
- Connect to your Ultra service via SSH.
- If it does not already exist, create a directory called
scripts
.
mkdir -p ~/scripts
- Then navigate to your newly created directory.
cd ~/scripts
- Get the absolute path of the directory.
pwd
- Take note of the output. In this guide, the output is
/home/ultradocs/scripts
. - Yours will have a different username.
ultradocs@spica:~$ mkdir -p ~/scripts
ultradocs@spica:~$ cd ~/scripts
ultradocs@spica:~/scripts$ pwd
/home/ultradocs/scripts
killstream.py
- Download the latest revision of the script.
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.
Test The Script:
- You can test your script by attempting to play a 4K media file and change the quality to 720p or lower. It will transcode for a while, after which you should get the stream kill message.
limiterr.py
- Download the latest revision of the script.
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
Configure 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 Ultra service timezone, which is UTC+01.)
Arguments
Playback Start:
--jbop limit --username {username} --sessionId {session_id} --grandparent_rating_key {grandparent_rating_key} --limit plays=3 --delay 60 --killMessage 'Goodnight!'
- 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.
If you require further assistance, you can open a support ticket here!
Feedback and suggestions regarding this article are welcome on our Discord server