In this section, we are going to set up a container to integrate our Docker environment with Azure's Operations Management Suite.
-
Add Docker management solution
- Open the Azure portal in your browser
- In the New blade under Marketplace, select Monitoring + management.
- In the Monitoring + management blade, click See all and search for Docker
- Click on Containers then click Create
- Click on Select a workspace and then click Create new workspace
- Provide the details for the new workspace, check “Pin to dashboard” and click OK
- After the validation click Create
- 'X' to close the blade, then click Create
-
Retrieve the workspace id and primary key
- On the Azure portal dashboard click on the Containers solution tile
- Click on the OMS Portal icon at the top
- Click on Data Sources connected tile on the home page, then open Connected Sources, and then click on Linux Servers
- Make note of (copy somewhere) the Workspace ID and Primary Key. Run the following:
export WSID=<your workspace id> export KEY=<your key>
- On the Azure portal dashboard click on the Containers solution tile
Phew, that's a lot of set up! Don't worry, it's worth it!
Run the following command:
sudo docker run --privileged -d -v /var/run/docker.sock:/var/run/docker.sock \
-v /var/log:/var/log -e WSID=$WSID -e KEY=$KEY \
-p 127.0.0.1:25225:25225 -p 127.0.0.1:25224:25224/udp \
--name="omsagent" -h=`hostname` --restart=always microsoft/oms
If this command returns an error, try running sudo /opt/microsoft/omsagent/bin/omsadmin.sh -X
. But please only do this in the event of an error.
Check OMS Docker view after a few minutes by clicking on the Containers tile on the OMS portal home page.
Note this can take some time to initially appear. You may want go on to another task and then come back to this.