Documentation
Monitors / Monitor network services

Monitor network services

Check WebSocket endpoints, TCP ports, ping hosts over ICMP with a packet loss threshold, and query a DNS server for A, AAAA, CNAME, MX or TXT records.

Four protocols check below the level of a web page: a WebSocket endpoint that accepts the handshake, a TCP port that accepts connections, a host that answers ping, and a DNS server that resolves a record.

WebSocket

A WebSocket Upgrade monitor opens a WebSocket connection and closes it as soon as the server accepts it. Use it for a chat, a live feed or a GraphQL subscription endpoint: an HTTP monitor does not prove that the upgrade works.

  • WebSocket URL: the address, starting with ws:// or wss://, for example wss://api.example.com/socket.

The Settings card adds:

  • Subprotocol (optional): sent in the Sec-WebSocket-Protocol header, for example graphql-ws. The check fails if the server does not accept it.
  • Ignore TLS / SSL errors for wss:// URLs: accept an expired or self-signed certificate. Off by default.

The check succeeds when the server answers 101 Switching Protocols: WebSocket upgrade successful (101 Switching Protocols) in 42ms. Otherwise the log gives the reason, for example WebSocket upgrade failed: server answered HTTP 403 instead of 101 Switching Protocols. No data is sent: the connection is closed right after the handshake.

Behind a reverse proxy, the WebSocket headers must be forwarded: a proxy that drops Upgrade and Connection makes the check fail while the HTTP site still works.

TCP

A TCP monitor opens a connection on a port and closes it. Use it for services without an HTTP endpoint: an SSH server, a database port, a game server.

The What to monitor card of a TCP monitorThe What to monitor card of a TCP monitor
A TCP check on port 5432.
  • TCP host: a host name, an IPv4 or an IPv6 address, for example db.internal, 10.0.0.20 or 2001:db8::20. Do not add a scheme: an http:// or https:// prefix is removed on save.
  • TCP port: the port, between 1 and 65535.

The check succeeds as soon as the connection opens. The log gives the time it took, for example TCP connection successful in 6ms.

Ping

A Ping monitor sends ICMP echo requests to a host.

The What to monitor card of a Ping monitorThe What to monitor card of a Ping monitor
A ping check on a host name.
  • Hostname / IP address: the host to ping, as a host name or an IPv4 address, for example home.example.com or 192.168.1.1. A scheme, a path or a port is ignored: https://home.example.com:8443/ pings home.example.com.
  • Heartbeat interval: a value between 1 and 60, asked by the form.

The Settings card adds the details of each check:

The Settings card of a Ping monitorThe Settings card of a Ping monitor
Packets, size and delay.
Field Default Meaning
Max packet loss 3 How many echo requests each check sends, between 1 and 10.
Packet size 56 Size of each packet in bytes, between 32 and 65500.
Delay between pings (ms) 2 Pause between two requests of the same check.

The result depends on how many replies arrive:

  • every reply: Healthy;
  • some replies: Degraded, for example 2/3 packets received (66%);
  • no reply: Unhealthy, Host unreachable or ICMP blocked;
  • a host name that does not resolve: Unhealthy, DNS resolution failed - hostname could not be resolved.

For a host name, the log also gives the address it resolved to, for example Ping successful to home.example.com (192.168.1.10): 3/3 packets received - Avg: 4ms.

Many cloud providers and firewalls drop ICMP. If a host never answers ping, check a TCP port or an HTTP endpoint instead.

DNS

A DNS monitor asks a DNS server for a record and checks that one comes back.

The What to monitor card of a DNS monitorThe What to monitor card of a DNS monitor
An A record lookup through 1.1.1.1.
Field Default Meaning
Url The domain to resolve, written as a URL: https://example.com or http://example.com resolves example.com.
DNS server 1.1.1.1 The IPv4 address of the resolver to ask. Cloudflare by default.
DNS port 53 The port of the DNS server.
DNS record The type of record to look for: A, AAAA, CNAME, MX or TXT.

The check fails when no record of this type exists. The log shows what was found, for example DNS lookup successful: A 93.184.215.14 in 14 ms.

A domain apex such as example.com cannot have a CNAME record: look for A or AAAA there, and keep CNAME for subdomains such as www.example.com.

Point the monitor at your authoritative server to check your own zone, or at a public resolver to check what your users see.

Suggest a change on GitHub