Skip to main content

Documentation

Complete guide to setting up website monitoring with PingZen. API documentation, code examples, and best practices.

A TCP monitor opens a connection to a host and port and reports whether the far end accepted it. A UDP monitor sends a datagram to a host and port and reports whether anything came back. Both answer the same question — is this port answering — but they answer it with very different confidence, and the second half of this page is mostly about that difference.

What It Is For

Services with no web interface

A database on 5432, Redis on 6379, a message broker on 5672, SSH on 22, a game server, an internal binary protocol. There is no URL to request and no status page to read — but the listener either accepts a connection or it does not, and that is usually the thing you actually want paged about.

:22:5432:6379

Services that only speak UDP

NTP on 123, SNMP on 161, VPN and game query ports do not answer a TCP connection at all, so a UDP monitor with the right payload is the only way to see them. DNS on 53 does listen on TCP too, but a bare connection there only says the port is open.

TCPUDP:123

A firewall rule, port forward or tunnel you just changed

A check from a PingZen region sees the port the way an outside user does, and catches the case where the service runs fine and something in front of it lets nobody in. For the same port as seen from inside, run the monitor from a private probe.

:5432

Proving a listener came back after a deploy or reboot

A process that crashed on startup leaves the port closed, and a closed port is the fastest unambiguous signal there is. If the service also greets you with a banner, TCP can read it and check that the right version is answering.

:22:22SSH-2.0-OpenSSH_9.6

What It Is Not For

A port check tells you the door opens. It does not tell you what is behind it:

You want to knowUse instead
Does the web service on that port work? A TCP check on 8080 succeeds while the application returns 500 to every requestHTTP / HTTPS monitor
Does the certificate expire soon? A TCP check never starts TLS, so it stays green until the day the certificate diesTLS/SSL certificate monitor
Is the machine reachable at all, when there is no port worth naming?Ping (ICMP) monitor
Is my DNS server returning the right records? A UDP check on 53 only proves something replied, not what it saidDNS monitor
Can mail still be sent and received? Port 25, 587, 993 or 995 being open says nothing about login, STARTTLS or the mailboxSMTP, IMAP or POP3 monitor
Does my proxy actually proxy? A TCP check on 1080 proves the port is open, not that the handshake, the credentials and the outbound path workSOCKS5 monitor, or the MTProxy monitor
Does the WebSocket endpoint still upgrade and echo messages? A TCP connect to 443 says nothing about the handshakeWebSocket monitor
Is a job or a device still alive when nothing of it is reachable from the internet?Heartbeat monitor, which the job calls instead

Why TCP and UDP Are Not the Same Check

TCPUDP?

TCP has a handshake. When the monitor connects, the far end either completes that handshake or it does not, and every outcome means something specific. An accepted connection proves a process is listening and accepting work. A refusal proves the host is up and nothing is listening on that port. Both are real answers.

UDP has no handshake. Sending a datagram is a local operation — the packet leaves, and the network is under no obligation to tell you what happened to it. So a UDP monitor cannot learn anything by sending alone. It has to send something the service will answer, and then wait for the answer. The reply is the entire proof.

That is why UDP checks need a payload that suits the service. Sending random bytes to a port makes most services ignore you, and being ignored looks exactly like being down.

What a TCP Check Does

  1. Opens a connection to the host and port.
  2. Records the time the connection took as the response time.
  3. Optionally reads the banner — the greeting many services send as soon as you connect, such as an SSH or SMTP version line.
  4. Closes the connection. The monitor never sends anything to the service — even a banner read only listens.

If you turn banner reading on, the monitor reads up to 1024 bytes, decodes them as text, and stores the result with the check. It waits at most 5 seconds for the banner, less when little of the monitor’s timeout is left — but always at least one second.

The banner is informational until you give it an expected keyword. With a keyword set, the check passes only if the keyword appears somewhere in the banner text, matched exactly, upper and lower case included. A missing banner, an empty one, a failed read or a keyword that is not there all turn the check red. Without a keyword, a banner that cannot be read does not fail anything — the check still passes on the connection alone and the banner is simply absent.

What a UDP Check Does

  1. Resolves the hostname. This has its own limit of 5 seconds, or the monitor’s timeout if that is shorter.
  2. Sends one datagram containing the payload.
  3. Waits for a reply until the timeout, unless you turned waiting off.
  4. Optionally compares the reply against an expected string, then records how many bytes came back.

If you do not set a payload, the monitor picks one by port:

PortWhat is sent by default
53 (DNS)A real DNS query — an A record lookup for example.com
123 (NTP)A standard NTP client packet
161 (SNMP)The same four bytes PING — SNMP needs your community string, so supply your own payload here
Any other portThe four bytes PING, which is a placeholder, not a protocol

For anything that is not DNS or NTP, plan on writing the payload yourself. The service decides what deserves an answer, and the default placeholder usually does not.

A UDP monitor needs an explicit port in its address. There is no assumed default: an address with no port fails the check immediately with a message saying so, because guessing a port would silently monitor the wrong thing.

Turning the Reply Requirement Off

UDP has a fire-and-forget mode: send the datagram and call the check successful as soon as it leaves the socket. Be clear about what that buys you. It proves the hostname resolved and the packet was handed to the network. It proves nothing whatsoever about the service at the other end, which may have been switched off for a month. A monitor in this mode will essentially never go down, so treat it as a send test, not availability monitoring.

What Silence Means

A timeout is the one result that reads differently on each protocol, and it is worth knowing which kind of silence you are looking at.

On TCP, silence is unusual. A host that is up and has nothing on the port normally refuses the connection at once, and the monitor records that refusal. Silence instead of a refusal usually means a firewall is dropping the packets rather than rejecting them, or the host itself is gone.

On UDP, silence is the normal way to be ignored. No reply can mean the service is down, or that a firewall dropped the request, or that the reply was dropped on the way back, or simply that the service did not consider your payload worth answering. The monitor cannot tell these apart, so a UDP monitor that times out is telling you “no answer”, not “the service is down”. Sometimes the operating system does receive an ICMP port-unreachable message, and then the check fails with that error instead of a timeout — but whether that message arrives is up to the network in between.

This is the practical consequence: a UDP monitor is only as trustworthy as the payload you send. Get the payload right and it is a genuine check. Get it wrong and it reports a permanent outage on a healthy service.

Status Logic

Neither monitor has a degraded state. There are no response-time thresholds on TCP or UDP — the result is up, down or timed out.

ResultStatus
TCP: the connection was accepted (and the banner keyword matched, if you set one)UP
TCP: the connection was refusedDOWN
TCP: the host did not resolve, the network refused the route, or another connection errorDOWN
TCP: a banner keyword is set and the banner is missing, empty, unreadable or differentDOWN
UDP: a reply arrived (and contained the expected text, if you set one)UP
UDP: a reply arrived but the expected text was not in itDOWN
UDP: the port is missing or out of range, the hostname did not resolve, or the port was reported unreachableDOWN
Either protocol: nothing happened before the timeoutTIMEOUT

Down and timeout both count as downtime and both open an incident — after the confirmation threshold, three consecutive failing checks by default, so one dropped packet does not page anyone.

Configuration

Address

Host and port, as example.com:5432. A scheme is accepted and stripped (tcp://, udp://), and IPv6 goes in brackets, as [2001:db8::1]:5432. The address is the only place the port lives — on a TCP monitor the separate Port field is just a convenient way to edit the :port part of that address.

Port

For TCP, leaving it out means port 80 — rarely what you meant, so set it. For UDP it is required and must be between 1 and 65535; a UDP monitor with no port fails every check on purpose.

Timeout

How long one check may take before it is recorded as a timeout. Five seconds by default. It covers the connection on TCP, and name resolution plus the wait for a reply on UDP.

Expect banner, and expected banner (TCP)

Off by default. The first setting turns the banner read on and records what the server said; the second adds a keyword the banner must contain. Use a keyword that a healthy service always prints and a broken one never does.

Payload (UDP)

The text sent in the datagram, encoded as UTF-8. Empty means the default for the port, from the table above.

Expect response, and expected response (UDP)

Waiting for a reply is on by default, and you should keep it on. The second setting adds text the reply must contain, matched exactly, upper and lower case included. Note that many services reply in binary, where a text match is not the right tool.

The TCP form has an Expected Response box: fill it in and the check reads the banner and requires that text in it; leave it empty and the check only proves the port accepts connections. The UDP payload and its expected response are still not in the form — set those through the REST API or the MCP tools, on the same monitor you created in the interface.

Key Features

  • One monitor type for any TCP or UDP port, with no agent on the target
  • TCP records the connection time and, on request, the server banner
  • Optional banner keyword on TCP and expected reply text on UDP, both turning a mismatch into a failure
  • Sensible UDP payloads for DNS and NTP built in, and a custom payload for everything else
  • A refusal, a timeout and an unreachable port are recorded as different errors, so the monitor page says what actually happened

Common Questions

What protocols can I monitor?

PingZen supports 23 protocols: HTTP/HTTPS, WebSocket (WS/WSS), TCP, UDP, ICMP Ping, gRPC, DNS, WHOIS, TLS/SSL certificates, Email (SMTP/IMAP/POP3), FTP/FTPS, DNSBL, PageSpeed, SOCKS5, MTProxy, API Check, and Transaction. You can monitor websites, APIs, servers, databases, and any network service.

How fast can I get alerts?

Telegram alerts are delivered within 1-2 seconds of detection. Slack and Discord notifications arrive almost instantly. You can configure multiple alert channels for redundancy.

Can I organize monitors by project?

Yes! PingZen supports workspaces, which let you organize monitors by project, environment, or team. Each workspace can have its own alert configurations and team members.

Is there an API for automation?

Absolutely. PingZen provides a full REST API with OpenAPI documentation. You can create, update, and delete monitors programmatically.

How do status pages work?

Status pages are public, branded pages showing your services' uptime. You can display real-time status and allow customers to subscribe for updates.

What happens if I reach my monitor limit?

We'll notify you when approaching your limit. You can pause some monitors or contact us for increased capacity. We never stop monitoring without warning, ensuring your critical services stay protected.

Ready to stop missing downtime?

Join thousands of teams who trust PingZen. Setup takes 30 seconds.