Skip to content

Instantly share code, notes, and snippets.

View jjbuchan's full-sized avatar

James Buchan jjbuchan

View GitHub Profile
@jjbuchan
jjbuchan / gist:83b03c1fb24ea1039fe25e9e44f822a2
Last active August 6, 2016 05:14
Re-evaluating for incident
If we receive an email with a list of accounts related to the ddos in LON, we need to do the following:
The email will likely be from Slade and will relate to a new comment in this gist - https://gist.github.rackspace.com/virg3823/efc9483068ea64bc879cdc2b9f35daa9
The last one I have run is "992837, als0FRG5zP" from https://gist.github.rackspace.com/virg3823/efc9483068ea64bc879cdc2b9f35daa9#gistcomment-4193
so look for anything after it.
You need to convert that to a list with just the tenant ids:
e.g.
I copy it into sublime and remove the alarm ids, then:
#!/usr/bin/env python
print "status ok results returned"
for x in xrange(300):
print "metric metric%d string %d" % (x, x)
if (metric['body_match'] == '') {
return new AlarmStatus(CRITICAL, 'URL response did not contain the correct content.');
}
if (metric['code'] != '200') {
return new AlarmStatus(CRITICAL, 'URL returned a #{code} code. Expected to receive a 200.');
}
return new AlarmStatus(OK, 'URL responds as expected.');