A blog probably of interest only to nerds by John Morton.

09Mar2019

Syn­ol­o­gy, Plex, ports and miss­ing URLs

I’ve had a Syn­ol­o­gy for many years, and the inter­face has changed over time, obscur­ing use­ful infor­ma­tion for installed apps.

One of my favorite apps to run on it is Plex. In the Syn­ol­o­gy inter­face, it used to be easy to open Plex. The URL was shown in the Pack­age Cen­ter” when look­ing up the app. 

Below is a screen­shot of how the inter­face used to look. This is not a screen­shot I cre­at­ed. I can’t show one of my own since mine no longer shows the URL.

Synology-plex-old-interface-crop

How the Synology interface used to look.

As the big arrow points out, there was a handy URL show­ing how to access the Plex appli­ca­tion run­ning on the Syn­ol­o­gy. Oth­er web apps run­ning on the Syn­ol­o­gy also had this handy URL in the Pack­age Cen­ter” interface. 

At some point, that URL part of the inter­face was no longer there.

Plex Package Center Synology Screenshot 09MAR2019

Plex Package Center Synology Screenshot, March 2019, showing no URL shortcut

That URL short cut is very use­ful. It turns out that it’s not miss­ing from the Syn­ol­o­gy inter­face entire­ly. It’s just moved.

Below are two screen­shots. The first points to the icon in the upper left cor­ner. If you hov­er your mouse over this icon, you’ll see it referred to as the Main Menu”. I would argue that this is a poor name for what this actu­al­ly rep­re­sents, but it’s what you’ll need to click to find the fol­low­ing screen with icons on it.

Synology-quicklink-shortcut-1
Synology-quicklink-shortcut-2

The short cut to get to installed apps clickable URLs.

Click­ing on the Plex icon takes me to http://192.168.1.20:32400/web/index.html, a URL on my local net­work. Take note of that port num­ber in the URL, 32400, I’ll ref­er­ence that again in a bit.

Each of the icons shown is a click­able link to a web app run­ning on the Syn­ol­o­gy. I did not say all web apps run­ning on your Syn­ol­o­gy though, and that’s why the rest of this post exists. This short­cut does work for some apps and not for oth­ers. My assump­tion is that some apps are writ­ten to pass infor­ma­tion back to Syn­ol­o­gy to allow this, but some aren’t.

How else might you find what the URL for Plex was if this didn’t exist? Fig­ur­ing this out will help find apps that don’t show up in this menu. 

An exam­ple of an app that doesn’t show up in this icon list is Dark­Stat. It’s a use­ful app that pro­vides a way to cap­ture net­work traf­fic, and has a web inter­face that serves up reports of sta­tis­tics,” accord­ing to its home­page. The web inter­face is some­thing you’ll need to track down on your own though because it doesn’t show up in the list of icons we just used to find Plex.

net­stat to the rescue

To find the ports that are being used on your Syn­ol­o­gy, we’ll need to log into it via the terminal. 

I won’t go into much detail on how to do that here. It’s eas­i­ly find­able on your search engine of choice, but the basics are that you need to enable it and know the IP address of your Syn­ol­o­gy. For exam­ple, you’d type some­thing like this into your terminal.

ssh admin@192.168.1.20 -p 22

This basi­cal­ly means login with the user­name admin” to some IP address on the local net­work spec­i­fy­ing a port, 22 in this example.

Assum­ing you’ve logged in, run netstat along with grep to fil­ter the results. (You can learn more on the net­stat Wikipedia page.) In this exam­ple, we’ll fil­ter by Plex Media”. I’ve wrapped it in quotes because it has a space in the text.

sudo netstat -lpna | grep "Plex Media"
Synology-netstat-plex

Results of sudo netstat -lpna | grep "Plex Media".

When I clicked the Plex icon in the Syn­ol­o­gy Main Menu, it took me to a URL with a spe­cif­ic port of 32400.

Look at the first few lines returned by the netstat com­mand. There are ref­er­ences to the tcp pro­to­col and some of those lines ref­er­ence the port 32400. One ref­er­ences an IP of 0.0.0.0:32400 and one 192.168.20:32400. That’s our Plex URL. We’ve found it with­out rely­ing on the Main Menu in the Syn­ol­o­gy interface.

Find­ing DarkStat’s IP

Now that we see how to use netstat to find some­thing we already know, we can try to find the Dark­Stat URL, which we don’t know. 

sudo netstat -lpna | grep dark
Synology-netstat-darkstat

There are few­er lines returned this time around, but only a sin­gle port is ref­er­enced, 667. Try­ing to load the Syn­ol­o­gy IP address in my brows­er with that port num­ber shows the Dark­Stat web interface. 

http://192.168.1.20:667/
Darkstat-screen-graphs

That’s how you can find the port and URL of an app run­ning on a Synology.