The branch, master has been updated via 5b70bb5 Switch over to using python mail-dead-hosts scripts. from f6aa956 Keep connection open while sending dead host notifications, only mark mail sent when not using dry run.
http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 5b70bb59f78911581d912e0aeeb317658e255bf6 Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 20:01:12 2010 +0100 Switch over to using python mail-dead-hosts scripts. ----------------------------------------------------------------------- Summary of changes: daily.sh | 2 +- mail-dead-hosts.pl | 88 ---------------------------------------------------- 2 files changed, 1 insertions(+), 89 deletions(-) delete mode 100755 mail-dead-hosts.pl Changeset truncated at 500 lines: diff --git a/daily.sh b/daily.sh index f57536c..8bc5304 100755 --- a/daily.sh +++ b/daily.sh @@ -7,7 +7,7 @@ set -x date set -x sqlite3 `dirname $0`/hostdb.sqlite 'VACUUM;' -cd `dirname $0` && ./mail-dead-hosts.pl +cd `dirname $0` && ./mail-dead-hosts.py echo "deleting old file that are not used any more" find `dirname $0`/data/oldrevs -type f -mtime +10 -links 1 -print0 | xargs -i -0 rm -f \{\} diff --git a/mail-dead-hosts.pl b/mail-dead-hosts.pl deleted file mode 100755 index 9ebaa7a..0000000 --- a/mail-dead-hosts.pl +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/perl -# Samba.org buildfarm -# Copyright (C) 2008 Andrew Bartlett <abart...@samba.org> -# Copyright (C) 2008 Jelmer Vernooij <jel...@samba.org> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# - -use FindBin qw($RealBin); -use POSIX qw(strftime); -use hostdb; -use Mail::Send; -use warnings; -use strict; - -my $db = new hostdb("$RealBin/hostdb.sqlite") or die("Unable to connect to host database: $!"); -my $dry_run = 0; - -my $hosts = $db->dead_hosts(7 * 86400); -foreach (@$hosts) { - - my ($fh, $msg); - - $db->sent_dead_mail($_->{host}) or die "Could not update 'last dead mail sent' record for $_->{host}"; - - # send an e-mail to the owner - my $subject = "Your build farm host $_->{host} appears dead"; - if ($dry_run) { - print "To: $_->{owner} <$_->{owner_email}>\n"; - print "Subject: $subject\n"; - open(MAIL,"|cat"); - } else { - $msg = new Mail::Send(Subject=>$subject, To=>"bui...@samba.org"); - $msg->set("From", "\"Samba Build Farm\" \<bui...@samba.org\>"); - $fh = $msg->open; - } - - my $last_update; - if (defined($_->{last_update})) { - $last_update = strftime ("%a %b %e %H:%M:%S %Y", gmtime($_->{last_update})); - } else { - $last_update = "a long time"; - } - - my $body = << "__EOF__"; -Your host $_->{host} has been part of the Samba Build farm, hosted -at http://build.samba.org. - -Sadly however we have not heard from it since $last_update. - -Could you see if something has changed recently, and examine the logs -(typically in ~build/build_farm/build.log and ~build/cron.err) to see -why we have not heard from your host? - -If you no longer wish your host to participate in the Samba Build -Farm, then please let us know so we can remove its records. - -You can see the summary for your host at: -http://build.samba.org/?function=View+Host;host=$_->{host} - -Thanks, - -The Build Farm administration team. - -__EOF__ - - if ($dry_run) { - print MAIL $body; - - close(MAIL); - } else { - print $fh "$body"; - $fh->close; - } -} - -1; -- build.samba.org