Hi thanks for the quick response. Please see the details below.
1. icmp socker error for testing run from inside container
$ curl -s '
127.0.0.1:9115/probe?target=172.0.16.90&module=icmp&debug=true'
Logs for the probe:
ts=2020-10-17T10:06:07.696205726Z caller=main.go:304 module=icmp target=172.0.16.90 level=info msg="Beginning probe" probe=icmp timeout_seconds=5
ts=2020-10-17T10:06:07.696325226Z caller=icmp.go:84 module=icmp target=172.0.16.90 level=info msg="Resolving target address" ip_protocol=ip4
ts=2020-10-17T10:06:07.696348246Z caller=icmp.go:84 module=icmp target=172.0.16.90 level=info msg="Resolved target address" ip=172.0.16.90
ts=2020-10-17T10:06:07.696361525Z caller=main.go:119 module=icmp target=172.0.16.90 level=info msg="Using source address" srcIP=0.0.0.0
ts=2020-10-17T10:06:07.696377468Z caller=main.go:119 module=icmp target=172.0.16.90 level=info msg="Creating socket"
ts=2020-10-17T10:06:07.696400989Z caller=main.go:119 module=icmp target=172.0.16.90 level=debug msg="Unable to do unprivileged listen on socket, will attempt privileged" err="socket: permission denied"
ts=2020-10-17T10:06:07.696444967Z caller=main.go:119 module=icmp target=172.0.16.90 level=info msg="Creating ICMP packet" seq=45267 id=5018
ts=2020-10-17T10:06:07.696464706Z caller=main.go:119 module=icmp target=172.0.16.90 level=info msg="Writing out packet"
ts=2020-10-17T10:06:07.696590348Z caller=main.go:119 module=icmp target=172.0.16.90 level=info msg="Waiting for reply packets"
ts=2020-10-17T10:06:12.696498118Z caller=main.go:119 module=icmp target=172.0.16.90 level=warn msg="Timeout reading from socket" err="read ip4
0.0.0.0: i/o timeout"
ts=2020-10-17T10:06:12.696736957Z caller=main.go:304 module=icmp target=172.0.16.90 level=error msg="Probe failed" duration_seconds=5.000476818
Metrics that would have been returned:
# HELP probe_dns_lookup_time_seconds Returns the time taken for probe dns lookup in seconds
# TYPE probe_dns_lookup_time_seconds gauge
probe_dns_lookup_time_seconds 1.451e-05
# HELP probe_duration_seconds Returns how long the probe took to complete in seconds
# TYPE probe_duration_seconds gauge
probe_duration_seconds 5.000476818
# HELP probe_icmp_duration_seconds Duration of icmp request by phase
# TYPE probe_icmp_duration_seconds gauge
probe_icmp_duration_seconds{phase="resolve"} 1.451e-05
probe_icmp_duration_seconds{phase="rtt"} 0
probe_icmp_duration_seconds{phase="setup"} 8.7043e-05
# HELP probe_ip_addr_hash Specifies the hash of IP address. It's useful to detect if the IP address changes.
# TYPE probe_ip_addr_hash gauge
probe_ip_addr_hash 2.606393893e+09
# HELP probe_ip_protocol Specifies whether probe ip protocol is IP4 or IP6
# TYPE probe_ip_protocol gauge
probe_ip_protocol 4
# HELP probe_success Displays whether or not the probe was a success
# TYPE probe_success gauge
probe_success 0
blackbox.yml
modules:
http_2xx:
http:
fail_if_not_ssl: false
fail_if_ssl: false
method: GET
no_follow_redirects: false
preferred_ip_protocol: ipv4
prober: http
timeout: 5s
https_2xx:
http:
fail_if_not_ssl: false
fail_if_ssl: false
method: GET
no_follow_redirects: false
preferred_ip_protocol: ipv4
prober: http
timeout: 5s
icmp:
icmp:
preferred_ip_protocol: ip4
source_ip_address: "0.0.0.0"
prober: icmp
timeout: 5s
irc_banner:
prober: tcp
tcp:
query_response:
- send: "NICK prober"
- send: "USER prober prober prober :prober"
- expect: "PING :([^ ]+)"
send: "PONG ${1}"
- expect: "^:[^ ]+ 001"
timeout: 5s
prometheus.yml
- job_name: blackbox
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox_exporter:9115 # The blackbox exporter.
- job_name: 'blackbox-ping'
metrics_path: /probe
params:
module: [icmp]
static_configs:
- targets:
- localhost
- 172.0.16.90 # internal can ping via icmp
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox_exporter:9115 # This is your blackbox exporter.
2. ssl_certificate negative values. Config files above added for ref.