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