Created
July 19, 2018 22:23
-
-
Save skyzyx/4383ecd7c480691df470857e63f88379 to your computer and use it in GitHub Desktop.
#Docker Engine API for #Datadog Agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sSL --unix-socket /var/run/docker.sock "http:/v1.37/containers/{id}/top" | jq | |
curl -sSL --unix-socket /var/run/docker.sock "http:/v1.37/containers/json" | jq -r '.[] | select(.Image == "datadog/agent") | .NetworkSettings.Networks.bridge.IPAddress' | |
curl -sSL --unix-socket /var/run/docker.sock "http:/v1.37/containers/json" | jq -r '.[] | select(.Image == "datadog/agent") | .Ports[] | select(.PublicPort) | .PublicPort' | |
curl -sSL \ | |
--unix-socket /var/run/docker.sock \ | |
"http:/v1.37/containers/json" \ | |
| jq -r ' | |
.[] | select(.Image == "datadog/agent") | [ | |
.NetworkSettings.Networks.bridge.IPAddress, | |
(.Ports[] | select(.PublicPort) | .PublicPort) | tostring | |
] | join(":") | |
' \ | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment