ObserveNow
...
Integrations
Endpoint Monitoring

Endpoint monitoring with Blackbox Exporter

Overview

Blackbox Exporter is used for endpoint monitoring and can help generate meaningful uptime and availability metrics. Blackbox Exporter allows blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP, ICMP and gRPC.

While most of the exporters use static configurations and then expose metrics accordingly, Blackbox Exporter works a little differently.

To setup Blackbox Exporter, we define modules which contain a set of targets/urls to monitor. Prometheus agent queries the blackbox exporter with these targets/urls which generates endpoint metrics like uptime, latency etc.

A sample configuration is shown below

Configuration

Add the following YAML snippets to the OpsVerse agent's values.yaml file.

YAML

YAML


Run the below command:

Shell


Single Machine

Alternatively, you can install the Prometheus Blackbox Exporter on a single machine.

Prerequisite(s):

Run this command to install the Blackbox Exporter as a systemd unit:

Shell

  • Edit the OpsVerse agent config file by using the following command:
Shell

  • Add the Blackbox exporter job under scrape_configs and edit the fields as required.
YAML

  • Edit the Blackbox exporter's config file by using the following command:
Shell


If the below content is alerady present in the config file, you can ignore the below step.

  • Add the below module to Blackbox exporter's config file.
YAML

  • Restart the prom-blackbox-exporter service and also the OpsVerse Agent by using the following commands:
Shell

  • Check status to confirm everything is working fine.
Shell


Custom Modules for Blackbox Exporter

You can configure custom modules in Blackbox exporter by defining the module in the blackbox config file and then updating scrape_configs section of agent-config.yaml to use the custom module. Some examples are provided below:

Appending Custom Headers with requests

Add the following module to the modules section in /etc/opsverse/exporters/blackbox/config.yaml

YAML


Then restart the blackbox-exporter as described above and update scrape_configs in /etc/opsverse/agent-config.yaml by adding the custom module to the params block:

YAML


The exporter will now send the defined headers to every target it is monitoring

Sending POST body to target

Add the following module to the modules section in /etc/opsverse/exporters/blackbox/config.yaml

YAML


Then restart the blackbox-exporter as described above and update scrape_configs in /etc/opsverse/agent-config.yaml by adding the custom module to the params block:

YAML


The exporter will now make a POST request with predefined body to every target it is monitoring

For more examples of custom blackbox-exporter modules, you can see the blackbox-exporter examples page.

Visualisation

OpsVerse ObserveNow provides an out of the box Blackbox Exporter/Endpoint Monitoring dashboard that can be used to provide a visual overview of your monitored endpoints.

Document image

Document image