Skip to content

Instantly share code, notes, and snippets.

@vagelim
Forked from miketheman/agent_version.sh-session
Last active May 22, 2017 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vagelim/0c4c294e5375b9dbafc2b3d5363a73fd to your computer and use it in GitHub Desktop.
Save vagelim/0c4c294e5375b9dbafc2b3d5363a73fd to your computer and use it in GitHub Desktop.
Retrieve metadata about systems from Datadog
# Ensure you have `jq` installed - http://stedolan.github.io/jq/
$ brew install jq
...
/usr/local/Cellar/jq/1.4: 15 files, 748K, built in 9 seconds
# Grab your API_KEY and create an APPLICATION_KEY from https://app.datadoghq.com/account/settings#api
$ export API_KEY=aaabbbccc
$ export APPLICATION_KEY=111222333
$ curl -s "https://app.datadoghq.com/reports/v2/overview?with_meta=true&api_key=$DD_API&application_key=$DD_APP" \
| jq -r '.rows[] | select(.meta.platform == "linux2")
| select(.meta.agent_version)
| [.name, .meta.agent_version] | @csv' | sort
"i-000000","5.13.0"
"i-0000","5.13.2"
"i-000","5.13.2"
"i-00","5.13.0"
"i-0","5.13.2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment