Hi
can you please configure this script.
#!/usr/bin/perl -w # use strict; use Net::SMTP; my $error = 0; #error flag my $user = 'email@domain.com'; my $smtp = 'mail.domain.com'; my $error_string = ''; open(LOG,"<","/var/vmware/datarecovery/operations_log.utx") || die "$!"; while (<LOG>) { chomp; s/\0//g; if(m/error/g) { $error = 1; $error_string .= qq( ----------------------------- $_\n \n\n ); } } close(LOG); if($error) { my $smtp = Net::SMTP->new( Host => $smtp, Hello => $smtp, Timeout => 30, Debug => 0, ); $smtp->mail('vmdr@domain.com'); $smtp->to($user); $smtp->data(); $smtp->datasend("To: $user\n"); $smtp->datasend("Subject: VMDR Backup log\n"); $smtp->datasend("\n"); $smtp->datasend("$error_string\n"); $smtp->dataend(); $smtp->quit; } else { exit; } _________________
Innovation distinguishes between a leader and a follower.