Riformattata mail failed matlab exec

This commit is contained in:
2021-01-06 10:39:50 +01:00
parent a50e06ca9d
commit ec57aaf3d5

View File

@@ -137,17 +137,18 @@ sub matlabCalc {
$matlabOutputError = <$fh>;
}
close($fh);
$matlabOutputError =~ s/\n/<br>/g;
my $exit_value = $? >> 8;
if ( $exit_value == 124 ) {
print getTimeStamp("log")
. " - pid $$ >> system @args excessive duration: killed after $matlab_timeout seconds\n";
$matlab_error =
"Maltab elab excessive duration: killed after $matlab_timeout seconds";
"Matlab elab excessive duration: killed after $matlab_timeout seconds";
}
else {
print getTimeStamp("log")
. " - pid $$ >> system @args failed: return code $exit_value - $?\n";
$matlab_error = "Maltab elab failed: $exit_value - $?";
$matlab_error = "Matlab elab failed: $exit_value - $?";
}
makeEmailMsg();
emailSend();
@@ -297,41 +298,42 @@ sub getMatlabCmd {
sub makeEmailMsg {
$email_msg = <<"END_MSG";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Alert from ASE</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Alert from ASE</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body style="margin: 0; padding: 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse;">
<tr>
<td align="center" bgcolor="#fff" style="padding: 10px 0 10px 0;">
<img src="https://www2.aseltd.eu/img/logo_ASE_small.png" alt="ASE" style="display: block;" />
</td>
</tr>
<tr>
<td bgcolor="#ffffff" style="padding: 10px 10px 10px 10px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="padding: 10px 10px 10px 10px;">
Alert from ASE: <BR>
Matlab function $matlab_cmd failed on unit => $unit - tool => $tool <BR>
$matlabOutputError <BR>
$matlab_error
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center">
<img src="https://www2.aseltd.eu/img/logo_ASE_small.png" alt="ASE" style="display: block;" />
</td>
</tr>
<tr>
<td align="center">
<h1 style="margin: 5px;">Alert from ASE:</h1>
</td>
</tr>
<tr>
<td align="center">
<h3 style="margin: 5px;">Matlab function $matlab_cmd failed on unit => $unit - tool => $tool</h3>
</td>
</tr>
<tr>
<td align="center">
<h4 style="margin: 5px;">$matlab_error</h4>
</td>
</tr>
<tr>
<td style="padding: 20px;">
$matlabOutputError
</td>
</tr>
</table>
</body>
</html>
END_MSG