Note
If the user wants to deploy the agent as a non-root user, use the following commands before you deploy the agent.
sudo usermod -aG docker $USER
Refer link https://docs.docker.com/engine/install/linux-postinstall/ for more information.
OR
sudo setfacl --m user:<user name or ID>:rw /var/run/docker.sock
Deploy agent without a proxy
docker run -d –net=host –name=opsramp-agent -v /var/run/docker.sock:/var/run/docker.sock -e AGENT_API_KEY=<api-key> -e AGENT_API_SECRET=<secret> -e APP_SERVER=<app server> -e LOG_LEVEL="warn" -e DOCKER_CONTAINER="TRUE" -e opsramp/agent
Deploy agent with a proxy
docker run -d –net=host –name=opsramp-agent -v /var/run/docker.sock:/var/run/docker.sock -e AGENT_API_KEY=<api-key> -e AGENT_API_SECRET=<secret> -e APP_SERVER=<app server> -e LOG_LEVEL="warn" -e DOCKER_CONTAINER="TRUE" -e PROXY_SERVER=<proxy_server_ip> -e PROXY_PORT=<proxy-port> -e PROXY_USER=<proxy username> -e PROXY_PASSWORD=<proxy password> -m CONN_MODE=proxy opsramp/agent
If you are not using the default seccomp profile, enter the security-opt label:disable
flag in the command:
docker run -it –security-opt label:disable -v /var/run/docker.sock:/var/run/docker.sock
Use the following command to validate that you are using the default seccomp
profile:
docker info | grep Profile
Note that you are not using the default seccomp profile
Profile: ``/etc/docker/seccomp.json`
docker run -v /var/run/docker.sock:/var/run/docker.sock –rm byrnedo/alpine-curl curl –unix-socket /var/run/docker.sock http:/localhost/info
curl: (7) Could not connect to server
curl: (7) Could not connect to server
For example,
docker run -d –net=host –name=opsramp-agent –security-opt label:disable -v /var/run/docker.sock:/var/run/docker.sock -e AGENT_API_KEY="<api-key>" -e AGENT_API_SECRET="<secret>" -e APP_SERVER="<app server>" -e LOG_LEVEL="warn" -e DOCKER_CONTAINER="TRUE" -e opsramp/agent
Manage docker events
On-boarded containers can be viewed in Setup > Infrastructure.
Alerts are triggered for events start, kill, and out-of-memory (oom) generated on the containers. Deleting a Docker host container also triggers an alert.
To stop receiving Docker alerts:
- On the host resource (Agent installed resource), navigate to
/opt/opsramp/agent/conf
. - Edit the
/opt/opsramp/agent/conf/configuration.properties
configuration file. - Enter 0 (zero) as the value in the
docker_events
field.
To start receiving docker alerts:
- Edit docker_events = 1 in
/opt/opsramp/agent/conf/configuration.properties
to enable docker events in normal agent.