Did you know you can view your currently open ports on your Synology NAS and monitor their status by using Task Scheduler? And you don’t need terminal for this. In computing, netstat (network statistics) is a command-line network utility that displays network connections and a number of network interface and some network protocol statistics. It is available on Linux, DSM (based on Linux) and other operating systems. Today I will teach you how to easily monitor open ports on your NAS and their status.
Activate email notifications. Go to Control Panel / Notification / Email / Check Enable email notifications and add your email credentials. After that select your current provider (in my case it’s Gmail). Click Apply. If you have already activated Notification via Email on your Synology NAS, skip this STEP.
Go to Control Panel / Task Scheduler / Create / Scheduled Task / User-defined script. Follow the instructions in the image below.
Once you click on User-defined script, a new window will open. Follow the instructions below:
- General: In the Task field type in “Port Status“. Uncheck the “Enabled” option. Select your current NAS user.
- Schedule: Select Run on the following date then select “Do not repeat“.
- Task Settings: Check “Send run details by email“, add your email then copy paste the code below in the Run command area. After that click OK.
After you click OK on STEP 4, select your “Port Status” Task then click the “Run” tab. You will be asked to run Port Status – click Yes. Follow the instructions in the image below.
Done! Now check your email. You will have all the open ports on your Synology NAS and their status in one email.
Note: In the email you will also see all the listening ports of your current Docker containers.
Note: You can also use terminal, but I prefer the Task Scheduler method so I can have a copy of everything in my email.
Note: You can also use the command line netstat -nap instead netstat -an on STEP 4 but you need to select “root” user instead of the current NAS user. You will get better details via email.
This post was updated on Tuesday / January 26th, 2021 at 12:22 AM