Jump to content

email notifier external script


Recommended Posts

Any tips on getting this to work? I have modified the script to include my server and an email address. I can send email with the included command line program (mainsndr.exe) and that seems to work. issuing the command retroeventhandler ATsendBUSReport seems to do nothing, but generates no obvious errors. I'm guessing that the script is unable to find the backup reports but it is unclear how the script should be told where these are located. I didnt specify a custom location for them on install. Thanks for any suggestions.

 

 

Link to comment
Share on other sites

  • 2 weeks later...

I got the same error on our W2k server box. The server used to be a NT4 server, & the notification works fine under NT4. We wiped it & installed W2k, rebuilt Retrospect 6 on it. I followed the instruction in the Retro manual to setup email notification using Scheduled Task. It didn't work. No email at all.

 

Therefore, I put in the script as AT command as instructed in the manual for NT4 machine. Notification works once again.

 

Hope this help.

Link to comment
Share on other sites

I didn't even bother trying to use their external script. I hate batch files!!!!! Instead I just wrote one in perl and used perl2exe to convert it into an executable. or you could even use a batch script to run this perl script but, then you would have to have perl installed on your machine.

 

 

 

Here is some code that I've been experimenting with.

 

 

 

All this does is email the arguements passed by the script to the eventhandler to you. I'm not sure if anyone else has been trying to create an accumulative report on all the data backed up on each client but, the arguenents passed by the script are different depending on the platform?

 

there are different EOL markers for each however, the sequence of information is the same

 

ie Script type, script name, volume name(path), volume name, client name, files copied, etc..... If you look at the arguements in the @ARGV array some times some information is bunched into the same arguement like this....

 

 

 

D:" ALPHAALPHA 21188 17 27 3/25/2003

 

 

 

[volume name, client name, kb stored, kb transfered, etc...]

 

 

 

On unix/mac clients these arguements are passed seperately and not in the same line(element of the @ARGV array)

 

 

 

So this means I have to write alot more code to "Find" these arguements. Run this script and you'll know what I'm talking about........

 

 

 

if you want to send the contents of a file just open it and set it to the @Argv array.

 

 

 

open(FILE, "C:\path\to\file") || die "Couldn't open file,\n";

 

@Argv = <FILE>;

 

close(FILE);

 

 

 

 

 

--Code Starts Here-----------------

 

 

 

#!/usr/bin/perl -w

 

use strict;

 

 

 

 

 

use Net::SMTP;

 

 

 

 

 

 

 

my $filenumber = scalar(@ARGV);

 

 

 

foreach my $line (@ARGV)

 

{

 

print "$line\n";

 

}

 

 

 

 

 

my @Argv;

 

foreach my $line (@ARGV)

 

{

 

my $arg = "$line\n";

 

push(@Argv,$arg);

 

}

 

 

 

push(@Argv,"Num elements is $filenumber\n");

 

 

 

Email_Summary();

 

 

 

 

 

 

 

sub Email_Summary{

 

 

 

 

 

 

 

my $subject = "Subject: Retrospect arguements\n";

 

 

 

 

 

 

 

my $smtp = Net::SMTP->new('IPofSNTPServer',Hello=>'IPofSNTPServer');

 

 

 

 

 

$smtp->mail('retro@yourdomain');

 

$smtp->to('yourname@yourdomain');

 

 

 

if ($smtp->data()){

 

print "Now sending data";

 

}else{

 

print "Not sending data";

 

}

 

$smtp->datasend($subject);

 

$smtp->datasend('');

 

$smtp->datasend(@Argv);

 

$smtp->dataend();

 

$smtp->quit;

 

 

 

} #End of Email_Summary function

 

 

 

----------------------

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...