Changeset 2251
- Timestamp:
- Mar 16, 2009, 8:26:19 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/outage/outage-mail
r2250 r2251 1 #!/usr/bin/python 1 2 import smtplib 2 3 from invirt.database import * 3 4 from email.mime.text import MIMEText 4 5 5 message = """One of the four XVM servers, aperture-science, spontaneously rebooted 6 today at around 2:55 today. As of now, we're not sure what the cause of 7 this was. 6 sender = 'Greg Price <price@mit.edu>' 7 sendername = sender.split()[0] 8 host = 'arklay-mansion' 8 9 9 Your VM %s was running on aperture-science. We have restarted it. 10 message = """\ 11 One of the four XVM host servers, %s, failed tonight at 12 about 23:17 and was rebooted. We're working to understand the cause. 13 14 Your VM %%s was running on %s. We have restarted it. 10 15 11 16 We realize that this is an inconvenience for you, and we apologize for 12 17 the unexpected downtime. 13 18 14 - Evan 15 for the XVM team""" 19 - %s 20 for the XVM team 21 """ % (host, host, sendername) 16 22 17 vms = " nforrest0 remus ghost-of-golezan tabbott 6470 dh moo mclamb dt-web htns uav-team x lsmb twopi what esg panache gardiner mailman-acl jack-o-tron knowledge ephialtes ocaml happy-go-lucky maridia cochese ocelot ecprice bibix groovy r privoxy thebes intrepid-paravirt-test qren2 quentin woodrow prolix oculus shinnyih gkovacs".split()23 vms = "amd64-test brain-trust cluster-test david-vista debathena-livecd-build ecprice gradbook greg-ns1 greg-ns2 groovy htns iodine jsoltren latex liftm medkaz mhd mksvn niska polarix price-lenny price-test8 qren2 shawn-of-awesome staxowax tdc tdc-secure thesecrete tor transistor watmap".split() 18 24 19 25 def send_mail(vm): … … 25 31 msg['CC'] = 'XVM <xvm@mit.edu>' 26 32 msg['Reply-To'] = 'XVM <xvm@mit.edu>' 27 msg['From'] = 'Evan Broder <broder@mit.edu>'33 msg['From'] = sender 28 34 msg['Subject'] = '[xvm] Unexpected reboot of your VM %s' % vm 29 s.sendmail( 'Evan Broder <broder@mit.edu>',35 s.sendmail(sender, 30 36 [contact, 'xvm@mit.edu'], 31 37 msg.as_string())
Note: See TracChangeset
for help on using the changeset viewer.