verifica monitor completed

This commit is contained in:
2021-02-04 21:56:06 +01:00
parent 2edd1e5f90
commit 5efa7672d1

View File

@@ -122,12 +122,7 @@ sub writeOutSql {
} }
sub matlabCalc { sub matlabCalc {
getMatlabCmd();
if ( $tool_status eq 'Monitoring Completed' ) {
print getTimeStamp("log")
. " - pid $$ >> $unit - $tool - Monitoring completed: MatLab calc by-passed.\n";
}
else {
$matlab_timestamp = getTimeStamp("db_ts"); $matlab_timestamp = getTimeStamp("db_ts");
print getTimeStamp("log") print getTimeStamp("log")
. " - pid $$ >> $unit - $tool MatLab calc started...\n"; . " - pid $$ >> $unit - $tool MatLab calc started...\n";
@@ -141,10 +136,8 @@ sub matlabCalc {
or die "cannot change: $!\n"; or die "cannot change: $!\n";
print getTimeStamp("log") print getTimeStamp("log")
. " - pid $$ >> current dir: $matlab_func_dir\n"; . " - pid $$ >> current dir: $matlab_func_dir\n";
my @args = ( my @args =
'timeout', $matlab_timeout, $matlab_cmd, $matlab_rt, $unit, ( 'timeout', $matlab_timeout, $matlab_cmd, $matlab_rt, $unit, $tool );
$tool
);
if ( system(@args) != 0 ) { if ( system(@args) != 0 ) {
open( my $fh, '<', $MatlabErrorFilename ) open( my $fh, '<', $MatlabErrorFilename )
or warn print getTimeStamp("log") or warn print getTimeStamp("log")
@@ -191,7 +184,7 @@ sub matlabCalc {
} }
print getTimeStamp("log") print getTimeStamp("log")
. " - pid $$ >> $unit - $tool MatLab calc executed.\n"; . " - pid $$ >> $unit - $tool MatLab calc executed.\n";
}
return; return;
} }
@@ -292,9 +285,10 @@ sub getMatlabCmd {
. " - pid $$ >> Could not connect to database: $DBI::errstr"; . " - pid $$ >> Could not connect to database: $DBI::errstr";
my $sth = $dbh->prepare( my $sth = $dbh->prepare(
'select m.matcall, t.ftp_send , t.unit_id from matfuncs as m 'select m.matcall, t.ftp_send , t.unit_id, s.`desc` as statustools from matfuncs as m
inner join tools as t on t.matfunc = m.id inner join tools as t on t.matfunc = m.id
inner join units as u on u.id = t.unit_id inner join units as u on u.id = t.unit_id
inner join statustools as s on t.statustool_id = s.id
where t.name = "' . $tool . '" and u.name = "' . $unit . '";' where t.name = "' . $tool . '" and u.name = "' . $unit . '";'
) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; ) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr";
@@ -627,6 +621,16 @@ if ( $tooltype eq "GD" ) {
print getTimeStamp("log") . " - pid $$ >> tool GD: nothing to do.\n"; print getTimeStamp("log") . " - pid $$ >> tool GD: nothing to do.\n";
} }
else { else {
getMatlabCmd();
print getTimeStamp("log")
. " - pid $$ >> $unit - $tool - Status $tool_status.\n";
if ( $tool_status eq 'Monitoring Completed' ) {
print getTimeStamp("log")
. " - pid $$ >> $unit - $tool - Monitoring completed: MatLab calc by-passed.\n";
}
else {
matlabCalc(); matlabCalc();
if ($ftp_send) { if ($ftp_send) {
@@ -636,6 +640,7 @@ else {
trxelab(); trxelab();
} }
} }
}
print getTimeStamp("log") . " - pid $$ >> Execution ended.\n"; print getTimeStamp("log") . " - pid $$ >> Execution ended.\n";
exit; exit;