Sign inSign up

dataphant/docker-aiops-ciagent

By dataphant

•Updated over 7 years ago

Container of Cloud intelligence Platform Agent.

Image
0

780

dataphant/docker-aiops-ciagent repository overview

⁠CiAgent Dockerfile

This repository is meant to build the base image for a CiAgent container. You will have to use the resulting image to configure and run the Agent.

⁠Quick Start

The default image is ready-to-go. You just need to set your hostname and LICENSE_KEY in the environment.

docker run -d --name ciagent -h `hostname` -v /var/run/docker.sock:/var/run/docker.sock -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e LICENSE_KEY={your_license_key_here} dataphant/docker-aiops-ciagent

If you are running on Amazon Linux, use the following instead:

docker run -d --name ciagent -h `hostname` -v /var/run/docker.sock:/var/run/docker.sock -v /proc/:/host/proc/:ro -v /cgroup/:/host/sys/fs/cgroup:ro -e LICENSE_KEY={your_license_key_here}
dataphant/docker-aiops-ciagent

⁠Configuration

⁠Environment variables

A few parameters can be changed with environment variables.

  • TAGS set host tags. Add -e TAGS="simple-tag-0,tag-key-1:tag-value-1" to use [simple-tag-0, tag-key-1:tag-value-1] as host tags.
  • LOG_LEVEL set logging verbosity (CRITICAL, ERROR, WARNING, INFO, DEBUG). Add -e LOG_LEVEL=DEBUG to turn logs to debug mode.
  • PROXY_HOST, PROXY_PORT, PROXY_USER and PROXY_PASSWORD set the proxy configuration.
  • CI_URL set the Cloudinsight intake server to send Agent data to Cloudinsight⁠
⁠Enabling integrations

To enable integrations you can write your YAML configuration files in the /conf.d folder, they will automatically be copied to /etc/CiAgent/conf.d/ when the container starts.

  1. Create a configuration folder on the host and write your YAML files in it.

    mkdir /opt/CiAgent.d
    touch /opt/CiAgent.d/nginx.yaml
    
  2. When creating the container, mount this new folder to /conf.d.

    docker run -d --name ciagent -h `hostname` -v /var/run/docker.sock:/var/run/docker.sock -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -v /etc/CiAgent.d:/conf.d:ro -e LICENSE_KEY={your_license_key_here} dataphant/docker-aiops-ciagent
    

    The important part here is -v /etc/CiAgent/conf.d:/conf.d:ro

Now when the container starts, all files in ``/etc/CiAgent/conf.dwith a.yamlextension will be copied to/etc/CiAgent/conf.d/`. Please note that to add new files you will need to restart the container.

⁠Build an image

To configure custom checks, or setup integrations straight in the image, you will need to build a Docker image on top of this image.

  1. Create a Dockerfile to set your specific configuration or to install dependencies.

    FROM dataphant/docker-aiops-ciagent
    # Example: MySQL
    ADD conf.d/mysql.yaml /etc/CiAgent/conf.d/mysql.yaml
    
  2. Build it.

    docker build -t ciagent-image .

  3. Then run it like the dataphant/docker-aiops-ciagent image.

    docker run -d --name ciagent -h `hostname` -v /var/run/docker.sock:/var/run/docker.sock -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e LICENSE_KEY={your_license_key_here} CiAgent-image
    
  4. It's done!

⁠Information

To display information about the Agent's state with this command.

docker exec ciagent service ciagent info

Warning: the docker exec command is available only with Docker 1.3 and above.

⁠Logs

⁠Copy logs from the container to the host

That's the simplest solution. It imports container's log to one's host directory.

docker cp ciagent:/var/log/CiAgent /tmp/log-CiAgent

⁠Supervisor logs

Basic information about the Agent execution are available through the logs command.

docker logs ciagent

⁠Limitations

Docker isolates containers from the host. As a result, the Agent won't have access to all host metrics.

Known missing/incorrect metrics:

  • Network
  • Process list

Also, several integrations might be incomplete.

Tag summary

Content type

Image

Digest

Size

119.7 MB

Last updated

over 7 years ago

docker pull dataphant/docker-aiops-ciagent