Skip to content

Instantly share code, notes, and snippets.

@ianblenke
Created May 2, 2015 17:57
Show Gist options
  • Save ianblenke/002a0f08a1c7647525a4 to your computer and use it in GitHub Desktop.
Save ianblenke/002a0f08a1c7647525a4 to your computer and use it in GitHub Desktop.
Remove non-reporting NewRelic servers
curl -sLX GET 'https://api.newrelic.com/v2/servers.json' \
-H "X-Api-Key:${NEW_RELIC_API_KEY}" | \
jq -r '.servers | [ .[] | select(.reporting == 'false') ] | .[] | ."id" ' | \
xargs -L1 -I% curl -X DELETE 'https://api.newrelic.com/v2/servers/%.json' \
-H "X-Api-Key:${NEW_RELIC_API_KEY}" -i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment