ribbybibby / ssl_exporter

Exports Prometheus metrics for TLS certificates
Apache License 2.0
504 stars 95 forks source link

How can I custom the resolve IP for tls certificate check ? #120

Closed leo69github closed 1 year ago

leo69github commented 1 year ago

How can I custom the resolve IP or domain for tls certificate check ?

I used to monitor the Certificate by Blackbox Exporter as below, I can manul setting the IP address and domain. http://10.0.8.77:9115/probe?module=http_2xx&target=https://172.217.163.36&hostname=www.google.com&debug=true

Recently Athough I successed via specify "server_name" in Module, but It looks like I need create a lot of modules to monitor a mount of domain and IP address.

Is there any advice to do this perpose?

ribbybibby commented 1 year ago

Currently the only option is to set server_name in the module configuration. Supplying it in the query params has been requested before but I erred on the side of following the blackbox_exporter, which previously didn't support the hostname parameter.

Now that the blackbox_exporter does support hostname, perhaps the ssl_exporter should follow suit.

leo69github commented 1 year ago

I found answer with below https://github.com/ribbybibby/ssl_exporter/pull/80/commits/978a8a83f019ad369e18c063685001709dbde601

Thanks