ICMP Ping
Certified
Check if hosts answer to ICMP ping
ICMP Ping
Check if hosts answer to ICMP ping
Probes each host sequentially with InetAddress.isReachable from the worker and returns a typed result per host: packets sent and received, loss, and min/avg/max round-trip time.
A host is reachable when at least one probe is answered. Use expect to fail the task when the outcome is not the one you want; for an "address must be free" check, set expect: UNREACHABLE. With the default ANY the task never fails because of reachability. All hosts are probed before the expectation is applied, and a single error lists every host that broke it.
ICMP privileges. The JDK does not run the ping binary. On Linux it needs a raw ICMP socket, which requires root or the CAP_NET_RAW capability (in a container, add it with --cap-add=NET_RAW). Setting net.ipv4.ping_group_range was not enough to enable ICMP in testing. Without that privilege, the JDK silently falls back to a TCP connection to port 7 (echo), which most hosts refuse or filter; the host may then be reported unreachable even though it is up. Make sure the worker has root or CAP_NET_RAW before relying on the result.
type: io.kestra.plugin.fs.icmp.PingExamples
Ping a list of hosts and log the result.
id: icmp_ping
namespace: company.team
tasks:
- id: ping
type: io.kestra.plugin.fs.icmp.Ping
hosts:
- 192.168.1.1
- example.com
count: 4
probeTimeout: PT1S
- id: log
type: io.kestra.plugin.core.log.Log
message: "All reachable: {{ outputs.ping.allReachable }}"
Fail if an IP address is already in use.
id: icmp_ip_must_be_free
namespace: company.team
tasks:
- id: ip_is_free
type: io.kestra.plugin.fs.icmp.Ping
hosts:
- 10.0.0.12
expect: UNREACHABLE
Wait until a device is back online.
id: icmp_wait_for_device
namespace: company.team
tasks:
- id: wait_for_device
type: io.kestra.plugin.core.flow.LoopUntil
condition: "{{ outputs.ping.results[0].reachable }}"
checkFrequency:
interval: PT10S
maxDuration: PT10M
failOnMaxReached: true
tasks:
- id: ping
type: io.kestra.plugin.fs.icmp.Ping
hosts:
- 192.168.1.50
count: 1
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
hosts *array
Hosts to ping
Host names or IPv4/IPv6 addresses, probed one after the other. At most 256 hosts per task; use ForEach for larger lists.
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
{}1150count integerstring
4Number of probes per host
Between 1 and 100.
expect string
ANYREACHABLEUNREACHABLEANYExpected outcome
REACHABLE fails the task if a host does not answer, UNREACHABLE fails it if a host answers or cannot be probed (DNS failure, network error), ANY never fails on reachability.
interval string
PT1SDelay between two probes of the same host
Between 0 and 1 minute.
probeTimeout string
PT1STimeout per probe
Between 1 millisecond and 1 minute. Applies to each probe only; the inherited task-level timeout is the overall limit and is not set by default.
Outputs
allReachable boolean
falseWhether every host is reachable
results array
One result per host, in input order
io.kestra.plugin.fs.icmp.Ping-HostResult
Error message, for example a DNS failure
The probed host
0Packet loss in percent
0Number of probes answered
0Number of probes sent
falseWhether at least one probe was answered
durationAverage round-trip time
Empty when no probe was answered.
durationMaximum round-trip time
Empty when no probe was answered.
durationMinimum round-trip time
Empty when no probe was answered.