Created
December 6, 2013 05:11
-
-
Save SerCeMan/7818905 to your computer and use it in GitHub Desktop.
JS script, which helps delete all inactive (gray) applications from NewRelic. Run script in JS console in Application view.
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
var yourId = 357957 | |
var table = document.getElementById('apptable'); | |
var rowLength = table.rows.length; | |
for(var i=1; i<rowLength; i+=1){ | |
var row = table.rows[i]; | |
var cellLength = row.cells.length; | |
if(row.cells[0].childNodes[0].getAttribute('alt') === 'Unavailable') { | |
var id = row.getAttribute('id').substring(12) | |
$.post('https://rpm.newrelic.com/accounts/'+yourId+'/applications/'+id, {'_method':'delete', 'format':'json'}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment