Skip to main content

Description

The check_port probe performs a TCP connect to verify whether a port on a host is reachable. Supports both expecting the port to be open (default) and expecting it to be closed. This is an active check — emits both metrics and a check result with latency.

Config fields

FieldTypeRequiredDefaultDescription
typestringYesMust be "check_port"
hoststringYesHost or IP to check
portintYesTCP port (1–65535)
expectOpenboolNotruetrue: expect port open → up on successful connect. false: expect port closed → up on connect failure

Metrics

MetricTypeUnitDescription
vms.check_port.statusstatusup or down
vms.check_port.latency_msgaugemsTCP connect time

Example config

{
  "type": "check_port",
  "host": "10.0.0.10",
  "port": 443,
  "expectOpen": true
}
Check that a port is closed:
{
  "type": "check_port",
  "host": "10.0.0.10",
  "port": 3389,
  "expectOpen": false
}

Notes

  • When the result doesn’t match the expectation, severity is critical.
  • A connect failure due to network is a normal result (status=down), not an agent error.