SSL Expiry panel in the blackbox exporter dashboard shows "YES" and no dates of when SSL will expire.

660 views
Skip to first unread message

Pooja Chauhan

unread,
May 9, 2020, 8:32:16 AM5/9/20
to Prometheus Users
I imported blackbox exporter dashboard but it doesn't not give the date of SSL certificate expiry which i want to be in grafana. Please suggest how to fix this.


ssl.PNG

Brian Candler

unread,
May 9, 2020, 9:25:58 AM5/9/20
to Prometheus Users
Modify your grafana panel then.

If you use the PromQL expression browser in prometheus (normally on port 9090) and start typing "probe_" you'll see from autocompletion that there's a metric called probe_ssl_earliest_cert_expiry, which gives you the actual expiry date as unix timestamp.

I don't know if Grafana can show unix timestamps as human-readable time, but the expression

    (probe_ssl_earliest_cert_expiry - time())/86400

will give you the number of days until it expires, which is perfectly fine as a gauge.  You can make it go yellow or red for values below thresholds that you choose.

Pooja Chauhan

unread,
May 10, 2020, 6:25:29 AM5/10/20
to Prometheus Users
Hi ,
I am using the query as mentioned by you : (probe_ssl_earliest_cert_expiry{job="blackbox"} - time())/86400  but it gives me value in minutes and not in days in grafana.

Whereas the output of prometheus is different .Pls suggest.
ssl_2.PNG
prom.PNG

Harald Koch

unread,
May 10, 2020, 10:35:16 AM5/10/20
to Prometheus Users
On Sun, May 10, 2020, at 06:25, Pooja Chauhan wrote:
Hi ,
I am using the query as mentioned by you : (probe_ssl_earliest_cert_expiry{job="blackbox"} - time())/86400  but it gives me value in minutes and not in days in grafana.

Whereas the output of prometheus is different .Pls suggest.

Grafana defaults to parsing the number as seconds. You can either change the units in Grafana to days, or remove the "/86400" from the formula. (For consistency I usually do the second one).

--
Harald

Pooja Chauhan

unread,
May 12, 2020, 5:03:31 AM5/12/20
to Prometheus Users

Hi Tried both the case but it is not working still showing seconds which should be number of days. The same works for me in another info dashboard which has similar information but it doest not work in this case.


On Saturday, May 9, 2020 at 6:02:16 PM UTC+5:30, Pooja Chauhan wrote:
ssl3.PNG

Brian Candler

unread,
May 12, 2020, 5:12:44 AM5/12/20
to Prometheus Users
* Remove the /86400 from the formula
* Hence the formula now returns number of seconds
* Grafana will scale this as appropriate - e.g. "10" displays as "10 seconds", but "7200" displays as "2 hours", etc.

Pooja Chauhan

unread,
May 12, 2020, 5:23:24 AM5/12/20
to Prometheus Users

hi I have removed /86400 from the formula still the issue persists .


On Saturday, May 9, 2020 at 6:02:16 PM UTC+5:30, Pooja Chauhan wrote:
ssl4.PNG
ssl.PNG

Brian Candler

unread,
May 12, 2020, 6:26:35 AM5/12/20
to Prometheus Users
Try turning on the "instant" button.

Pooja Chauhan

unread,
May 12, 2020, 6:34:51 AM5/12/20
to Prometheus Users
No not working , i tried turning on "instant" button :(  . Any other alternative ?


On Saturday, May 9, 2020 at 6:02:16 PM UTC+5:30, Pooja Chauhan wrote:
ssl5.PNG

Brian Candler

unread,
May 12, 2020, 9:34:41 AM5/12/20
to Prometheus Users
All I can say is, it works perfectly for me with grafana 6.6.2.  Panel configured as follows:

img1.png



img2.png


Pooja Chauhan

unread,
May 12, 2020, 9:42:45 AM5/12/20
to Prometheus Users
Hi can you pls attach the panel images in a way  i can download it because i am not able to see it clearly .


On Saturday, May 9, 2020 at 6:02:16 PM UTC+5:30, Pooja Chauhan wrote:

Pooja Chauhan

unread,
May 12, 2020, 9:46:02 AM5/12/20
to Prometheus Users
BTW i am using grafana 6.7.2 and 6.7.3 , for 6.7.3 it works and for 6.7.2 it does not. Is this with the version shall i upgrade it and check ?


On Saturday, May 9, 2020 at 6:02:16 PM UTC+5:30, Pooja Chauhan wrote:

Brian Candler

unread,
May 12, 2020, 10:07:09 AM5/12/20
to Prometheus Users
In Chrome, right click and "show image in new tab" shows it clearly.

Pooja Chauhan

unread,
May 12, 2020, 10:15:46 AM5/12/20
to Prometheus Users
Ok. Any comment on the grafana version ?


On Saturday, May 9, 2020 at 6:02:16 PM UTC+5:30, Pooja Chauhan wrote:
Reply all
Reply to author
Forward
0 new messages