#!@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
# 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;
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;
#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");
}
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;
}