From a50e06ca9da22078eddcd67490155b3669280af3 Mon Sep 17 00:00:00 2001 From: Alessandro Battilani Date: Fri, 1 Jan 2021 17:21:18 +0100 Subject: [PATCH] modificata mail con in vio errori --- LoadCSVData.pl | 12 ++++++++++++ SendFtpElabData.pl | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/LoadCSVData.pl b/LoadCSVData.pl index 9d6b76f..5cddb49 100755 --- a/LoadCSVData.pl +++ b/LoadCSVData.pl @@ -53,6 +53,8 @@ my $G201_fcheck = 0; my $D2W_fcheck = 0; my $FtpToCustomerCmd = 'SendFtpElabData.pl'; my ( $scriptname, $scriptpath ); +my $MatlabErrorFilename = "/tmp/"; +my $matlabOutputError = ''; sub getTimeStamp { # parm [ts] => timestamp for filename; log => timestamp for log @@ -116,6 +118,7 @@ sub matlabCalc { . " - pid $$ >> $unit - $tool MatLab calc started...\n"; if ( $matlab_cmd =~ /_lnx$/ ) { $matlab_cmd = './run_' . $matlab_cmd . '.sh'; + $MatlabErrorFilename .= "${unit}${tool}_output_error.txt"; #print $ENV{"HOME"} . "\n"; $ENV{"HOME"} = "/" . $ENV{"HOME"}; @@ -126,6 +129,14 @@ sub matlabCalc { my @args = ( 'timeout', $matlab_timeout, $matlab_cmd, $matlab_rt, $unit, $tool ); if ( system(@args) != 0 ) { + open( my $fh, '<', $MatlabErrorFilename ) + or warn print getTimeStamp("log") + . " - pid $$ >> Cannot open Matlab output error file: ${MatlabErrorFilename}\n"; + { + local $/; + $matlabOutputError = <$fh>; + } + close($fh); my $exit_value = $? >> 8; if ( $exit_value == 124 ) { print getTimeStamp("log") @@ -310,6 +321,7 @@ sub makeEmailMsg { Alert from ASE:
Matlab function $matlab_cmd failed on unit => $unit - tool => $tool
+ $matlabOutputError
$matlab_error diff --git a/SendFtpElabData.pl b/SendFtpElabData.pl index 8f3673f..9805acf 100755 --- a/SendFtpElabData.pl +++ b/SendFtpElabData.pl @@ -124,7 +124,7 @@ sub trxelab { while ( my ( $key, $value ) = each(%ftp_parms) ) { print getTimeStamp("log") - . " - pid $$ >> $key = $ftp_parms{$key}\n"; + . " - pid $$ >> - $key = $ftp_parms{$key}\n"; } if ( !defined $duedate