Containers: How to run a Monitoring Stack on IBM Z

There are different options to start a Monitoring Stack on IBM Z.
The first option is to follow the steps from this article to build your own Docker images and yield: 
  • grafana/grafana:dev
  • prom/prometheus-linux-s390x
  • prom/alertmanager-linux-s390x
  • prom/node-exporter-linux-s390x
  • google/cadvisor:beta
Another option is to use a pre-built stack of Docker images, provided by other solutions:
From the ICP package:
  • ibmcom/prometheus:v2.8.0
  • ibmcom/node-exporter:v0.16.0-f3
  • ibmcom/alertmanager:v0.15.0-f3
  • ibmcom/cadvisor-s390x:0.31.0
  • ibmcom/grafana:5.2.0-f3
Finally, you can also use Docker images based on the ClefOS image (without the cadvisor component):
  • clefos/prometheus-node-exporter:v0.16.0
  • clefos/prometheus-alertmanager
  • clefos/prometheus:v2.3.2
  • clefos/grafana

 

How to run

The next steps illustrate how to run the images on Ubuntu 18.10 with docker-compose.

Prerequisites

First off, install the docker-compose package
apt-get install docker-compose -y

The download the this Github project with sample configuration
git clone https://github.com/s390x-container-samples/s390x-container-monitoring
cd s390x-container-monitoring

The .env file in the repository is required to specify Docker images for docker-compose to run.
There are 3 possible lists:
  • Docker images with builds from source (prom-source-build.env)
  • Docker images from ICP CE package (prom-icp-ce.env)
  • Docker images from ClefOS org (prom-clefos.env)
You just need to create symbolic link between *.env and .env file
By default .env link is for prom-clefos.env.

There are 3 configuration files for docker-compose, which are for the following two use cases:
  • docker-compose.yml - the simpler one - runs the whole stack on one machine
  • docker-compose-federation.yml and client/docker-compose.yml for the Prometheus federation case. You need to use docker-compose-federation.yml on the server and client/docker-compose.yml on the clients

Run the stack


For the first use case just put the IP address of your machine in prometheus/prometheus.yml and run docker-compose:
sed -i 's/MACHINE_IP/127.0.0.1/g' prometheus/prometheus.yml
docker-compose up

Check http://MACHINE_IP:9090/targets to verify that all Prometheus targets are running. There should be information about cAdvisor, Prometheus and Node-Exporter, and they should all be up and running.
If not, check the docker-compose logs and fix the respective problems.

Configure Grafana to have metrics visual presentation

Open http://MACHINE_IP:3000 (admin/password) and familiarize yourself with Grafana.
Add a Data Source to Grafana by choosing the Prometheus Data Source template.
At the settings tab, put in the URL of the Prometheus HTTP server and save the data source.

Grafana Data Source for Prometheus


Import Grafa Dashboard with https://grafana.net/dashboards/179
Dashboard import in Grafana

As a result you will get Docker and Host Monitoring with Prometheus Dashboard:

Grafana dashboard for docker containers running on the host

No comments:

Post a Comment

Popular Posts