X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=application-src%2Fscript-email.pl;h=07694ac7b287d8593a05477f2a3896b9a05d3493;hb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;hp=b16f6a69b259c9d22ae51fb9f36ef06329e85e02;hpb=2627875b7d18858bc1f9f7652811e4d8c15a23eb;p=debian%2Famanda diff --git a/application-src/script-email.pl b/application-src/script-email.pl index b16f6a6..07694ac 100644 --- a/application-src/script-email.pl +++ b/application-src/script-email.pl @@ -1,5 +1,5 @@ #!@PERL@ -# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2008, 2009, 2010 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -14,11 +14,12 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com use lib '@amperldir@'; use strict; +use warnings; use Getopt::Long; package Amanda::Script::Script_email; @@ -33,7 +34,7 @@ use Amanda::Constants; sub new { my $class = shift; my ($execute_where, $config, $host, $disk, $device, $level, $index, $message, $collection, $record, $mailto) = @_; - my $self = $class->SUPER::new($execute_where); + my $self = $class->SUPER::new($execute_where, $config); $self->{execute_where} = $execute_where; $self->{config} = $config; @@ -65,86 +66,103 @@ sub command_support { #something sub command_pre_dle_amcheck { my $self = shift; + $self->sendmail("pre-dle-amcheck"); } sub command_pre_host_amcheck { my $self = shift; + $self->sendmail("pre-host-amcheck"); } sub command_post_dle_amcheck { my $self = shift; + $self->sendmail("post-dle-amcheck"); } sub command_post_host_amcheck { my $self = shift; + $self->sendmail("post-host-amcheck"); } sub command_pre_dle_estimate { my $self = shift; + $self->sendmail("pre-dle-estimate"); } sub command_pre_host_estimate { my $self = shift; + $self->sendmail("pre-host-estimate"); } sub command_post_dle_estimate { my $self = shift; + $self->sendmail("post-dle-estimate"); } sub command_post_host_estimate { my $self = shift; + $self->sendmail("post-host-estimate"); } sub command_pre_dle_backup { my $self = shift; + $self->sendmail("pre-dle-backup"); } sub command_pre_host_backup { my $self = shift; + $self->sendmail("pre-host-backup"); } sub command_post_dle_backup { my $self = shift; + $self->sendmail("post-dle-backup"); } sub command_post_host_backup { my $self = shift; + $self->sendmail("post-host-backup"); } sub command_pre_recover { my $self = shift; + $self->sendmail("pre-recover"); } sub command_post_recover { my $self = shift; + $self->sendmail("post-recover"); } sub command_pre_level_recover { my $self = shift; + $self->sendmail("pre-level-recover"); } sub command_post_level_recover { my $self = shift; + $self->sendmail("post-level-recover"); } sub command_inter_level_recover { my $self = shift; + $self->sendmail("inter-level-recover"); } @@ -164,7 +182,7 @@ sub sendmail { debug("cmd: $Amanda::Constants::MAILER $args\n"); my $mail; open $mail, '|-', $Amanda::Constants::MAILER, @args; - print $mail "$self->{config} $function $self->{host} $self->{disk} $self->{device} ", join (" ", @{$self->{level}}), "\n"; + print $mail "$self->{action} $self->{config} $function $self->{host} $self->{disk} $self->{device} ", join (" ", @{$self->{level}}), "\n"; close $mail; }