Skip to content Use Monity from Claude, ChatGPT or Codex: set up monitors and ask what changed, from a chat. Use Monity from Claude, ChatGPT or Codex Connect yours
Tutorial 3 min read

TCP port monitoring: an alert when a server stops accepting connections

TCP port monitoring checks that a server still accepts connections on a port. What a port check tells you and what it misses next to ping and application checks, the common ports to watch, why a database port shouldn’t face the internet, and how to set one up.

Alex Lead Product Designer
UpdatedNovember 26, 2026 Read time3 min AudienceIT, DevOps and hosting teams

TCP port monitoring checks that a server still accepts connections on a port, such as 587 for sending mail, 22 for SSH or 5432 for PostgreSQL, and alerts you when it refuses them or stops answering. It’s the uptime check for the services that aren’t web pages. Monity (monity.ai) port monitors open a connection from the internet every 30 seconds to every hour, depending on the plan, and re-check a failure 3 and 6 seconds later before they alert.

What a port check tells you, and what it doesn’t

Check Tells you Misses
Ping (ICMP) The host answers on the network A service that stopped, and hosts or firewalls that drop ping
TCP port Something is listening on the port and the firewall lets you through A service that accepts connections but fails: a database refusing queries, a mail server rejecting mail
Application The service does its job: an HTTP status and answer, a page’s text, a sign-in that works Problems outside what it checks, and it needs an address that answers HTTP

So a port check sits in the middle: stronger than ping for a service, weaker than a check of the service itself. Where the service has a web front or a health endpoint, watch that too. Monity’s port monitors make a TCP connection; they don’t ping. For a one-off ping, use the free ping check.

Common ports to watch

From the IANA port number registry:

Port Service Watch it for
25 SMTP Mail from other servers reaching yours
587 Message submission Your apps and users sending mail
465 Message submission over TLS (RFC 8314) The same, over TLS from the first byte
993 IMAP over TLS People reading their mail
22 SSH Being able to get into a server
3306 and 5432 MySQL and PostgreSQL A database other services reach over the network
6379 Redis A cache or queue other services depend on
3389 Remote Desktop (“MS WBT Server”) Remote access to a Windows machine

Should a database port face the internet?

Usually not, and you shouldn’t open one just to monitor it. A port monitor checks from the internet, so it only makes sense for a port that’s meant to be reachable there, like a mail server’s. For a database behind a firewall, watch what is public instead (the app’s health endpoint, with a check on its JSON answer), or have a job inside your network call a heartbeat link: no call in time, and you get the alert.

Check a port by hand

  • macOS and Linux: nc -vz mail.example.com 587
  • Windows PowerShell: Test-NetConnection mail.example.com -Port 587

Run it from outside your network too: a port can be open from the office and closed from the internet. Monity’s free port checker tests a public host and port from outside your network.

Set up a port monitor in Monity

  1. Add an uptime monitor and choose Port. Enter a public host name or IP address and the port. Private addresses are refused, since Monity checks from the internet.
  2. Choose how often. Every 5 minutes on the free plan, every minute on plans that check pages every 15 to 60 minutes, every 30 seconds on plans that check pages every 5 minutes. 1,000 checks use one credit, so a monitor checked every minute uses about 44 credits a month.
  3. Choose where alerts go: email, Slack, Microsoft Teams, Discord, Telegram, a webhook or the phone app, with a reminder until someone acknowledges and a message when it’s back.
  4. Add it to a status page if your users depend on the service, and set a maintenance window for planned work, so it isn’t counted as downtime.
Creating a port monitor in Monity: host mail.example.com, port 587, named Mail server (SMTP)
A port monitor needs a public host and a port, here a mail server’s submission port 587. Monity counts it as up when the connection is accepted.

When the port stops answering, Monity opens an incident with the failed check’s status and timings and a likely cause, and the downtime counts in the monitor’s SLA report. More: every kind of uptime monitor, uptime monitoring, API monitoring, cron job monitoring and SSL certificate expiry monitoring.

FAQ

Questions people ask

What is TCP port monitoring?

A scheduled check that opens a connection to a host and port, and alerts you when the port refuses it or doesn’t answer in time. It shows that a service is listening and reachable.

Is port monitoring the same as ping?

No. Ping (ICMP) shows the host answers on the network; a port check shows a service on that port accepts connections. Some servers and firewalls drop ping while their services work.

How do I check if a port is open?

Run nc -vz host port on macOS or Linux, or Test-NetConnection host -Port port in Windows PowerShell, from outside your network as well as inside.

Which ports does email use?

Port 25 for mail between servers, 587 for submission from apps and people, 465 for submission over TLS, and 993 for IMAP over TLS, as the IANA registry lists them.

Can Monity monitor a port on my private network?

No. Monity checks from the internet, so private addresses are refused. For a service inside your network, watch a public health endpoint, or send a heartbeat from inside.

How often are ports checked?

Every 30 seconds to every hour, depending on the plan: every 5 minutes on the free plan. A failure is re-checked 3 and 6 seconds later before an alert.

Written by

Alex

Alex leads product design at Monity. From the plain-English setup to the way an alert is laid out, her work is about making website monitoring something anyone can use, technical or not. She writes here about product design and usability.

More by author
Kamil, Alex and Martyna A person replies within two working days

Have a question?

Pricing, security or scoping: pick one and your message goes to a person on the team.