From 6013a2a998b15a5ca638272941dee9149926ef03 Mon Sep 17 00:00:00 2001 From: battilo Date: Fri, 6 Apr 2018 22:15:17 +0200 Subject: [PATCH] modifica x messaggio --- AlertNotReceived.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/AlertNotReceived.pl b/AlertNotReceived.pl index 7448752..51270e8 100644 --- a/AlertNotReceived.pl +++ b/AlertNotReceived.pl @@ -131,9 +131,6 @@ if ($sth->rows < 0) { $ToolName{$results->{'ToolNameID'}}{'ErroriTotaliLetture'} = "--"; if ($results->{'ToolState'} eq "Active" ){ $act_tool++; - } - if (substr($results->{'ToolNameID'},0,2) eq "GD" ){ - $act_tool++; } } } @@ -150,25 +147,29 @@ my $stw = $dbh->prepare("select ToolNameID, EventDate, count(EventTime) 'Letture $stw->execute(); if ($stw->rows == 0) { - print getLoggingTime() . " - No rows from RAWDATA.\n"; + print getLoggingTime() . " - No rows from RAWDATACOR.\n"; $email_obj = "ATTENZIONE: nessuna lettura pervenuta!!!" } else { while (my $results = $stw->fetchrow_hashref) { $ToolName{$results->{'ToolNameID'}}{'LettureNodi'} = $results->{'LettureNodi'}; $ToolName{$results->{'ToolNameID'}}{'LettureCatene'} = $results->{'LettureCatene'}; $ToolName{$results->{'ToolNameID'}}{'NumeroNodi'} = $results->{'NumeroNodi'}; - $ref_date = $results->{'EventDate'}; + $ref_date = $results->{'EventDate'}; + if (substr($results->{'ToolNameID'},0,2) eq "GD" ){ + $gd_tool++; + } } if (($act_tool + $gd_tool) == $stw->rows) { $email_obj = "Tutte le letture pervenute."; } else { $email_obj = "ATTENZIONE: alcune letture non pervenute!!!"; } + print getLoggingTime() . " - tool attivi: $act_tool - GD tool: $gd_tool - righe query: " . $stw->rows . ".\n"; } $stw->finish; -my $ste = $dbh->prepare("select ToolNameID, count(val0) 'ErroriTotaliLetture' from RAWDATA where EventDate = ? and val0 = 'Err1' group by ToolNameID") +my $ste = $dbh->prepare("select ToolNameID, count(val0) 'ErroriTotaliLetture' from RAWDATACOR where EventDate = ? and val0 = 'Err1' group by ToolNameID") or die getLoggingTime() . " - $DBI::errstr"; $ste->bind_param(1, $ref_date); $ste->execute();