Last active
July 26, 2016 23:08
-
-
Save mattevans/6bec39eb1035b48dc1a3a154c98a02ca to your computer and use it in GitHub Desktop.
Remove non-reporting NewRelic servers
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
# Requires curl, jq and xargs | |
curl -X GET 'https://api.newrelic.com/v2/servers.json' \ | |
-H "X-Api-Key:YOUR_API_KEY_HERE" \ | |
| jq -r '.servers | .[] | select(.reporting!=true) | .id' \ | |
| xargs -I % curl -X DELETE https://api.newrelic.com/v2/servers/%.json \ | |
-H "X-Api-Key:YOUR_API_KEY_HERE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment