Plex server seedbox/vps restart script or notification?

Hi,

I’m trying to find a way to restart Plex on a remote server without root access when the machine goes down for maintenance.

I cant code or know much about Linux. so I looked for scripts and only found this one https://gist.github.com/fwenzel/2495425, but it doesn’t work. I think it’s because I need root privileges

#!/bin/bash

If plex is not running, don’t do anything.
plex_running=ps ax | grep "\./Plex Media Server" | awk '{ print $1 }' | wc -l
if [ “$plex_running” -eq 1 ]; then
exit 0
fi

Test Plex web interface. If it’s dead, this’ll time out in a few seconds.
curl -I -m 8 “http://localhost:32400/library/sections” > /dev/null 2>&1
if [ “$?” -ne “0” ]; then
/usr/sbin/service plexmediaserver restart
fi

OR, IS THERE a way to get informed straight away when the server doesn’t have access? And is there a way to restart the server manually with a html link or something similar? Like the ones used to refresh libraries and such?

At least this way, I could know as soon as it happens and if I’m not available have a browser link for my older users to just click and have it back working if I’m offline for long.

Thanks guys

Perhaps Tautulli has that ability.

It does, but don’t get the notifications. Cause Tautulli also goes down. Sometimes I do, but it’s not often.

I have found that maybe using telegram bot is a good way for me but can’t find a way to get something to send the message in the first place. Just want a message to let me know it’s down

Why is plex not automatically restarting when the server comes back up? Which provider?

If the machine is down for maintenance then you would not be able to restart it anyway.

You can run Tautulli on a different machine, it does not need to run on the same machine as your plex install

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.