Skip to main content

probe.icmp

ICMP probing allows you to monitor the availability and responsiveness of networked devices by sending ICMP Echo Request packets (pings) and measuring the response times.

Arguments

You can use the following arguments with probe.icmp:

NameTypeDescriptionDefaultRequired
scrape_intervaldurationInterval at which targets should be pinged.1mno
targetslist(object)List of ICMP targets to probe. See target arguments below.no
target_fromreferenceReference to a discovery configuration to load targets from.no
forward_tolist(reference)List of exporter references to send metrics to.yes

Target Arguments

NameTypeDescriptionDefaultRequired
ipv4stringIPv4 address to ping.no*
fqdnstringFully qualified domain name to ping (will be resolved to IP).no*
timeout_secintegerTimeout in seconds for the ICMP request.15no
labelsmap(string)Labels to attach to this target.no
scrape_intervaldurationOverride global scrape interval for this target.1mno

*At least one of ipv4 or fqdn must be provided.

Example

Plain text configuration with IPv4 addresses

probe "icmp" "servers" {
scrape_interval = "30s"
targets = [
{
ipv4 = "8.8.8.8"
timeout_sec = 10
labels = {
service = "dns_google"
env = "production"
}
},
{
ipv4 = "1.1.1.1"
timeout_sec = 10
labels = {
service = "dns_cloudflare"
env = "production"
}
}
]

forward_to = [exporter.otlp.otlp]
}

Configuration with FQDN targets

probe "icmp" "endpoints" {
scrape_interval = "60s"
targets = [
{
fqdn = "google.com"
timeout_sec = 15
labels = {
service = "google"
env = "production"
}
},
{
fqdn = "cloudflare.com"
timeout_sec = 15
labels = {
service = "cloudflare"
env = "production"
}
}
]

forward_to = [exporter.otlp.otlp]
}

From a discovered file

discovery "file" "icmp_targets" {
path = ["./targets/icmp.json"]
}

probe "icmp" "discovered" {
target_from = discovery.file.icmp_targets
forward_to = [exporter.otlp.otlp]
}

Resources