Changeset 42972 for trunk/ippMonitor/czartool/czarpoll.pl
- Timestamp:
- Mar 19, 2026, 5:23:27 PM (4 months ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/czartool/czarpoll.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/czartool/czarpoll.pl
r42931 r42972 26 26 use czartool::DayMetrics; 27 27 use czartool::MetricsIndex; 28 29 # --- Logging setup --- 30 use IO::Handle; 31 my $log_file = "/tmp/czarpoll.log"; 32 open(my $LOG, '>>', $log_file) or die "Cannot open log file $log_file: $!"; 33 $LOG->autoflush(1); 34 select($LOG); # Redirect all print statements to the log file 35 open(STDERR, '>&', $LOG) or die "Cannot redirect STDERR to log file: $!"; 28 36 29 37 my $period = 60; … … 149 157 my @labels = @{$pantasks->getLabels($server,'gpc1')}; 150 158 push (@allLabels, @labels); 159 #print "[$server gpc1] labels: ", join(", ", @labels), "\n"; 151 160 152 161 my @labels2 = @{$pantasks->getLabels($server,'gpc2')}; 153 162 push (@allLabels2, @labels2); 163 #print "[$server gpc2] labels: ", join(", ", @labels2), "\n"; 154 164 } 155 165 #The way gpc2 pantasks are set up is different from gpc1. Therefore, the same label can appear in both stdscience and distribution. … … 309 319 while (1) { 310 320 321 # --- Truncate log file at start of each iteration --- 322 close($LOG); 323 open($LOG, '>', $log_file) or die "Cannot reopen log file $log_file: $!"; 324 $LOG->autoflush(1); 325 select($LOG); # Redirect STDERR (error messages) to the same log file 326 open(STDERR, '>&', $LOG) or die "Cannot redirect STDERR to log file: $!"; 327 328 print "\n======================== CZARPOLL ITERATION START ========================\n"; 329 print scalar(localtime) . "\n"; 330 print "==========================================================================\n"; 331 311 332 my $iterationStartTime = time(); 312 333 … … 447 468 448 469 print "--------------------------------------------------------------------------\n"; 470 print "Iteration complete at " . scalar(localtime) . "\n"; 471 print "==========================================================================\n"; 449 472 if ($iterationTime < $period) { 450 473 print "* Going to sleep\n";
Note:
See TracChangeset
for help on using the changeset viewer.
