From cb73e2a3963392c6670bc3de3a3db3993126bba7 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 16 Mar 2009 20:26:19 -0400 Subject: [PATCH] outage-mail: small improvements, mostly update for tonight's outage svn path=/trunk/scripts/outage/; revision=2251 --- outage-mail | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/outage-mail b/outage-mail index 4968135..ed75737 100644 --- a/outage-mail +++ b/outage-mail @@ -1,20 +1,26 @@ +#!/usr/bin/python import smtplib from invirt.database import * from email.mime.text import MIMEText -message = """One of the four XVM servers, aperture-science, spontaneously rebooted -today at around 2:55 today. As of now, we're not sure what the cause of -this was. +sender = 'Greg Price ' +sendername = sender.split()[0] +host = 'arklay-mansion' -Your VM %s was running on aperture-science. We have restarted it. +message = """\ +One of the four XVM host servers, %s, failed tonight at +about 23:17 and was rebooted. We're working to understand the cause. + +Your VM %%s was running on %s. We have restarted it. We realize that this is an inconvenience for you, and we apologize for the unexpected downtime. -- Evan -for the XVM team""" +- %s +for the XVM team +""" % (host, host, sendername) -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() +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() def send_mail(vm): contact = Machine.query.filter_by(name=vm).first().contact @@ -24,9 +30,9 @@ def send_mail(vm): msg['To'] = contact msg['CC'] = 'XVM ' msg['Reply-To'] = 'XVM ' - msg['From'] = 'Evan Broder ' + msg['From'] = sender msg['Subject'] = '[xvm] Unexpected reboot of your VM %s' % vm - s.sendmail('Evan Broder ', + s.sendmail(sender, [contact, 'xvm@mit.edu'], msg.as_string()) -- 1.7.9.5