TCP Check
Certified
Check if a TCP port is open
TCP Check
Check if a TCP port is open
Opens a TCP connection to host: port and closes it right away without sending any payload. The port is open when the connection is established within connectTimeout. A filtered port ends at connectTimeout and is reported as closed.
Use expect to fail the task when the outcome is not the one you want; with the default ANY the task never fails on reachability. An invalid host or port fails the task instead of being reported as closed.
type: io.kestra.plugin.fs.tcp.CheckExamples
Check that a database port is open.
id: tcp_check
namespace: company.team
tasks:
- id: check_db
type: io.kestra.plugin.fs.tcp.Check
host: db.example.com
port: 5432
connectTimeout: PT3S
expect: REACHABLE
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-fs --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
Properties
host *string
Target host or IP
port *integerstring
Target port
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150connectTimeout string
PT5SConnection timeout
Between 1 millisecond and 5 minutes. Applies to the connection attempt only; the inherited task-level timeout is the overall limit.
expect string
ANYREACHABLEUNREACHABLEANYExpected outcome
REACHABLE fails the task if the port is closed, UNREACHABLE fails it if the port is open or the host cannot be probed (DNS failure, no route), ANY never fails. A refused connection or a timeout counts as not open.
Outputs
connectTime string
durationTime to establish the connection
Empty when the port is closed.
error string
Error message when the connection failed
open boolean
falseWhether the connection was established