4.2 Installing cAdvisor in Docker Environments

cAdvisor monitors the dockerised endpoints information such as CPU, memory usage, filesystem, and network statistics.

Perform the following steps on the OES server (UMC or CIS):

  1. Download the cAdvisor docker image from the docker hub.

    docker pull google/cadvisor

  2. Run the script to configure cAdvisor service. See, cadvisor.sh.

    cadvisor.sh

    cAdvisor metrics is available on port 8080 to view individual server metrics.

  3. After the installation of the cAdvisor on a target, update the static Prometheus server configuration and restart the Prometheus service.

    1. On the Prometheus (Monitoring) server edit the Prometheus configuration file.

      /etc/prometheus/exporter-config.yml.

    2. Update the IP address and port details of the cAdvisor in the targets section (highlighted in the example below).

      global:
         scrape_interval: 15s
      
      scrape_configs:
         - job_name: Docker Servers
      static_configs:
              - targets: ['localhost:8080'. '<cadvisor installed server>:8080']
         - job_name: OES Servers
           static_configs:
             - targets: ['localhost:9100','oesnode01:9100','oesnode02:9100']
  4. Restart the service after the configuration file is updated.

    systemctl daemon-reload
    systemctl restart prometheus.service