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:
- https://www.robustperception.io/
- http://prometheus.io/blog
- https://devconnected.com/
- https://github.com/
- https://www.bogotobogo.com/
- http://www.columbia.edu/
- http://www.http2demo.io/
- https://www.w3schools.com/
- https://xxxxxx1.com/
- http://xxxxxx2.com/
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
- prometheus.io
- robustperception.io
- google.com
- hotmail.com
- 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.
On Friday, October 16, 2020 at 10:06:41 PM UTC+1 [email protected] wrote:
> > Out of three ip address (cmd ping works fine) two ip address
> probe_status==0 and still fails now this time timeout reading error from
> socket err="read ip4 0.0.0.0 i/o timeout".
>
> Test it using curl:
>
> curl 'a.a.a.a:9115/probe?module=XXX&target=Y.Y.Y.Y'
>
> where a.a.a.a is docker container address. Alternatively if you can
> docker exec into the container, and there is curl inside the container,
> then you can do
>
> curl '127.0.0.1:9115/probe?module=XXX&target=Y.Y.Y.Y'
>
> Here's what I get when I probe an address that is not reachable (1.2.3.4):
>
> $ curl '127.0.0.1:9115/probe?module=icmp&target=1.2.3.4'
> # 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 5.2838e-05
> # HELP probe_duration_seconds Returns how long the probe took to complete
> in seconds
> # TYPE probe_duration_seconds gauge
> probe_duration_seconds 3.000263382
> # HELP probe_icmp_duration_seconds Duration of icmp request by phase
> # TYPE probe_icmp_duration_seconds gauge
> probe_icmp_duration_seconds{phase="resolve"} 5.2838e-05
> probe_icmp_duration_seconds{phase="rtt"} 0
> probe_icmp_duration_seconds{phase="setup"} 0.000278196
> # 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 3.268949123e+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
>
> This is with the following blackbox.yml config:
>
> modules:
> icmp:
> prober: icmp
> timeout: 3s
>
>
> > Also my second issue is my ssl certificate (openssl) is nearly more than
> 6 months to expire but its showing as expired and expiring in 30 days.
>
> Go to the PromQL browser in Prometheus web interface, and enter the
> expression
>
> probe_ssl_earliest_cert_expiry - time()
>
> What does it show? If you get a negative number then it sounds to me like
> one of the certificates in the chain has expired, but unless you tell us
> the domain name (and the server is reachable over the Internet), we can't
> check.
>
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/d5087d8b-798b-4934-aa33-0e48c8fa89e4n%40googlegroups.com.