Table of Contents
In this article, I will guide you to monitor website and SSL with blackbox exporter. In the previous article, you learned how to use blackbox exporter to monitor host ping.
Now, we continue to use the blackbox exporter but to monitor website HTTP code and SSL expiration.
Configure prometheus monitor website and ssl
Open the prometheus configuration file.
nano /etc/prometheus/prometheus.ymlAdd the following content to the end of the file and save.
- job_name: 'blackbox'
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- https://www.google.com
- https://www.youtube.com
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9115You change the URLs in the targets section to the websites you want to monitor. Note that you type the URL correctly, including the http (https) part in front of the domain.
Reload prometheus configuration.
systemctl reload prometheusSet up the grafana dashboard
In this part, you do the same as importing dashboard monitor ping.
In the Import dashboard section, enter ID 9965. This is the Chinese interface dashboard.
If you want to use my version with a little customization in English, you can download this JSON file.
Instead of importing ID, in the Import via panel json section, copy the json file content there and click Load.
And as a result, you will get an interface that looks like this.

If you encounter an error that some panels are not displayed on the dashboard, type the command below to install the necessary plugins.
grafana-cli plugins install grafana-image-renderer
grafana-cli plugins install camptocamp-prometheus-alertmanager-datasource
grafana-cli plugins install grafana-piechart-panelAnd then, restart the grafana service.
service grafana-server restartConclusion
With just a few quick steps, you have a website monitor interface. In the next part, I will guide you to install prometheus bot to send alerts to telegram. A monitoring tool would be of no use if it couldn’t send us warnings, right?