Basic Plex Media Server Monitoring?

Hello All,

I was wondering if there was a simple tool/app that could let me know if my PMS is offline.

Unfortunately, remote access to my server is prone bouts of failure. Ideally, I would like be informed of such an occurrence through a notification on my android phone as it happens.

Currently, I’ve got PlexWatch and PlexWatchWeb (fantastic work by ljunkie and ecleese, respectively and many thanks to Jason for the instructional video) working with Pushbullet notifications to my phone. Does anyone know a way to use these tools to achieve said result?

I use a combination of Pulseway (but not sure if it’s free anymore) that warns me when the external ip address changes and www.uptimerobot.com monitors my external port and sends a push message when the port can’t be reached.

Depending on the OS you use, you can use a simple script that executes every 15, 20 or 30 minutes to test for the remote functionality. I’m using an Asustor NAS for my PMS device, so it uses a flavor of Linux. I have a script that runs every 20 minutes that checks remote acces using this script. (This is a shell script, called via a chron job, so working with a different OS might have different requirements.)

#!/bin/sh

curl -I -m 8 "http://putyour.DDNShost.namehere:#####/web/index.html"
if [ "$?" -ne "0" ]

then
/usr/sbin/syslog --log 0 --level 0 --user admin --event "Remote Access to Plex is unavailable"

                /usr/local/AppCentral/plexmediaserver/CONTROL/start-stop.sh stop
                sleep 5
                /usr/local/AppCentral/plexmediaserver/CONTROL/start-stop.sh start
fi

exit 0

I’m sure there are ways to do this with WinXX or Mac, or other OS’s, just have to research how to make a call like curl with your OS.

This script basically hits the outside DDNS name and port of my PMS, and if there is a returned html, it exits, if there isn’t, it stops the server, waits for 5 seconds and then starts it again. I have this set up to run every 20 minutes, and it also writes to the log file for the device to send me a message that Plex was restarted. I can then go into the log files to see why it failed, and can try to fix the issue if it’s an on-going problem.

This method doesn’t require any third party apps to run. Everything came straight from the manufacturer. I have Android clients on my phone to get the log messages, written by the manufacturer, so I can get the reports.

This just checks if the server is running. The issue you really need to concentrate on is why does your access keep dropping out. Is PMS crashing? Are you using mapped ports or uPnP? Is the device PMS installed on having issues with other apps? You have to fix this underlying problem to get true stability on your system.

Thanks for the replies!

@WilhelmStroker
Why does the external IP change? Is that a good measure of PMS connectivity?

Pulseway seems like a handy application, but perhaps a little too much for my needs.

@MikeG6.5
I’m not very adept at coding or server jargon I’m afraid. I am using Windows 8.1 on my PMS device and the disconnects are more a result of the ISP being unreliable or someone restarting the router in the house for god knows why. The router restarts and internet is fine, but the remote access needs a swift kick to get back into action. It’s automatically set with NAT, as far as I know.

From what you described, it seems your script is the answer I’m looking for. Although, I would probably need more than a little assistance getting it to work with my setup.

There’s the free https://uptimerobot.com/

NAT or uPnP is buggy at best. Consistent connections are much easier to maintain by using mapped ports. This means the server boradcasts on a single port tot he world, and any traffic coming back on that port only goes to the server.

What creates problems with uPnP is the ports could change from one day to the next, or even one hour to the next, and your connection gets scrambled up. As you kick off internet games, console games, etc. they may request a port that’s already in use via uPnP and things get even more confused.

Look online for your router manual and read up on mapping or forwarding ports. Map port 32400 to your PMS device’s static IP address. (You are going to need to read up on that in the router’s manual, too.) In the PMS settings -> Server -> Remote Access set up a Manually Specified Port to 32400 and check the check mark. Hit apply.

Try to get to the server now, through plex.tv and it should be there. Remote access should be much more stable after you do this.

Let us know how this works for you.

@yousifjb said:
Thanks for the replies!

WilhelmStroker
Why does the external IP change? Is that a good measure of PMS connectivity?

Pulseway seems like a handy application, but perhaps a little too much for my needs.

MikeG6.5
I’m not very adept at coding or server jargon I’m afraid. I am using Windows 8.1 on my PMS device and the disconnects are more a result of the ISP being unreliable or someone restarting the router in the house for god knows why. The router restarts and internet is fine, but the remote access needs a swift kick to get back into action. It’s automatically set with NAT, as far as I know.

From what you described, it seems your script is the answer I’m looking for. Although, I would probably need more than a little assistance getting it to work with my setup.

My ISP changes my external ip address regularly and my router then tends to lose its port forwarding, so I have Pulseway set up to monitor that, and the Plex server process in case it crashes. Uptimerobot.com is probably your best bet to monitor external access.

@WilhelmStroker
I might be mistaken, but I believe your external IP is set by your router. The fact that it’s changing could mean you have it set for dynamic addresses (I think it’s called DHCP), and as @MikeG6.5 suggested, static IP with manually set port forwarding is more stable - so if your current setup is causing you some headaches, it might be worthwhile to look into that.

But respect for figuring out such a solution - it’s way beyond me, that’s for sure.

@yousifjb said:
WilhelmStroker
I might be mistaken, but I believe your external IP is set by your router. The fact that it’s changing could mean you have it set for dynamic addresses (I think it’s called DHCP), and as MikeG6.5 suggested, static IP with manually set port forwarding is more stable - so if your current setup is causing you some headaches, it might be worthwhile to look into that.

But respect for figuring out such a solution - it’s way beyond me, that’s for sure.

Yeah, that’s not what I said at all. There is a huge difference in a static local IP and a static WAN IP.

Your WAN (external) IP is actually set by your ISP. If you have a static IP, you know it, because you are paying extra to have it. If you have a DHCP assigned IP, you probably will never be sure of your WAN IP without a DDNS service running to keep the routing tables up to date. Your ISP is going to tell you how they want the router/modem set up, or they are going to have their tech set it up the way they want it. You could get into some trouble with them by messing with it, unless you have clearance before hand to do it.

Port forwarding is only pointing to a device(s) on the local side. You are opening a hole in the router’s rules to allow requests for access to come in on a port and go to a specific device on the inside of your network. This hole you open has to go to a specific device that is set up to listen on that port for activity. Opening it up to a DHCP assigned local IP won’t work because it could go to a device that isn’t listening, or isn’t even there. When you make a port forward rule, the router doesn’t check if the device is present, but it does check if the IP is DHCP or static. (At least most GOOD routers do this check.)

BTW, when you open up this hole, you are opening up your router to potential security risks. Someone can use this hole to try to exploit your device or network.

uPnP/NAT was supposed to be an answer to this. Ports could be opened dynamically, when the services requested those ports. The problem comes in when the router sees no activity on the uPnP port so the router closes the port down to clear up it’s local tables and memory. Now someone makes a request, but the port is no longer open, so it gets rejected. Some higher end routers you can configure this clearing, others you can’t. The bottom line is simple… This method doesn’t work well for an always on, always wanting to have access service like PMS. It works great for on-line games or VOIP services.

With a static local IP and port forwarding rules, the request is only rejected if the device in question isn’t turned on or not present on the local network. This port that is forwarded is ALWAYS open. That means the router is ALWAYS listening for activity on that port, whether there is a device to respond to it or not.

If you are having issues with remote access, the first thing most on this forum will tell you to do is set up forwarding rules. If you’ve done this and still have problems, there’s either something wrong with the router, the device you have PMS installed on or the installation itself causing your problem.

@WilhelmStroker
Please forgive my ignorance, you obviously know your own business better than I do.

@MikeG6.5
Sorry for misquoting you, it seems I have a lot to learn about networking. Thanks for the quick crash course though. I’ll certainly be referring to it as I learn more.

Or you could try https://www.domotz.com/ which is a home monitoring service. Costs about €2.99/month to monitor everything in your house including your NAS box, plex server and anything else you might want to keep an eye on.