...
Code Block | ||
---|---|---|
| ||
chmod +x prometheusrun-container.sh ./prometheusrun-container.sh |
Docker will then download the latest official Prometheus Docker image, create and configure the container and then run said container.
...
Code Block | ||
---|---|---|
| ||
sudo systemctl daemon-reload
sudo systemctl enable --now node_exporter |
We've already setup node_exporter in our prometheus configuration file (see lines 31 to 34).
View Git file | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Installing and configuring blackbox (to monitor endpoints)
Blackbox exporter is a prometheus exporter which can probe endpoints via http/https, icmp, etc. It's extremely simple to setup and can be used to monitor the status of various endpoints (which could be web applications, REST endpoints, etc.).
We'll be using the a docker image to install and configure Blackbox exporter.
Start by cloning https://gitlab.jaytaala.com/docker/blackbox:
Code Block | ||
---|---|---|
| ||
git clone https://gitlab.jaytaala.com/docker/blackbox |
Similar to our prometheus docker image install, the repo contains only two files (which are the only two we need):
- run-container.sh : shell script that will run our docker command to install / configure blackbox exporter;
- config.yml : single configuration file for for blackbox exporter.
To setup and run our blackbox exporter simply make the run-container.sh executable and run it:
Code Block | ||
---|---|---|
| ||
chmod +x run-container.sh
./run-container.sh |
This will start blackbox-exporter
on the default port (9115). The config.yml
file is similar to the default blackbox-exporter
config.yml
, but set the preferred ip protocol to ipv4 (by default it uses ipv6).
We've already setup blackbox-exporter
in our prometheus configuration file (see lines 36 to 57).
View Git file | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Info |
---|
Note: the internal ip address on line 57 must be the actual ip address of our host (not Add any other endpoints in the |
Installing and configuring Grafana
Grafana is a great
Finally, we install and setup grafana
References
- https://prometheus.io/
- https://github.com/prometheus/node_exporter
- https://prometheus.io/download/#node_exporter
- https://github.com/prometheus/blackbox_exporter
- https://grafana.com/
Related articles
...