Changeset 40879 for trunk/ippMonitor
- Timestamp:
- Aug 29, 2019, 12:02:53 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/czartool/czarpoll.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/czartool/czarpoll.pl
r40877 r40879 128 128 ########################################################################### 129 129 sub updateLabels { 130 my ($dbupdate) = @_; 130 131 131 132 # this used to have a concept of labels grouped by pantasks server, but we … … 200 201 201 202 # store them all in stdscience: 202 $server = "stdscience"; 203 if (@allLabels) { 204 $czarDb->updateCurrentLabels($server, \@allLabels,'gpc1', \@priorities); 205 } else { 206 print "WARNING: No labels to update for gpc1 for '$server'\n"; 207 } 208 209 if (@allLabels2) { 210 $czarDb->updateCurrentLabels($server, \@allLabels2,'gpc2', \@priorities2); 211 } else { 212 print "WARNING: No labels to update for gpc2 for '$server'\n"; 203 if($dbupdate == 1) { 204 $server = "stdscience"; 205 if (@allLabels) { 206 $czarDb->updateCurrentLabels($server, \@allLabels,'gpc1', \@priorities); 207 } else { 208 print "WARNING: No labels to update for gpc1 for '$server'\n"; 209 } 210 211 if (@allLabels2) { 212 $czarDb->updateCurrentLabels($server, \@allLabels2,'gpc2', \@priorities2); 213 } else { 214 print "WARNING: No labels to update for gpc2 for '$server'\n"; 215 } 213 216 } 214 217 return(\@allLabels,\@allLabels2); … … 244 247 my ($period) = @_; 245 248 249 my $dbupdate; 246 250 my $polldate; 247 251 my $datenow; … … 271 275 # main polling loop 272 276 while (1) { 277 my $iterationStartTime = time(); 278 273 279 #get the time of last czarpoll update 274 280 $polldate = $czarDb->getPollDate(); … … 279 285 $datenow=DateTime->now; 280 286 $timediff = ($datenow->epoch) - ($date->epoch); 281 if($timediff < 300.) { 287 if($timediff > 120.) { 288 print "There is no recent Czarpoll iteration\n"; 289 print "*Updating database entries*\n"; 290 $dbupdate = 1; 291 } else { 282 292 print "There is a recent Czarpoll iteration already made ($timediff sec ago)\n"; 283 print "* Going to sleep\n"; 284 sleep($period); 285 print "* Waking up\n"; 286 287 next; 288 } 289 290 my $iterationStartTime = time(); 293 print "*Skipping database queries and entries*\n"; 294 $dbupdate = 0; 295 } 296 291 297 292 298 # sort out times … … 318 324 319 325 # now cleanup tables from yesterday and optimize 320 print "* Performing database cleanup\n"; 321 $czarDb->cleanupDateRange($yesterday, $yesterday, $config->getCzarCleanupInterval()); 322 print "* Optimizing the database\n"; 323 $czarDb->optimize(); 326 #TdB20190703: The ipp113 and ipp117 instances of czarpoll use the same stage DBs in czarDB. 327 #Therefore, it makes no sense to run the cleanup+optimising twice 328 #print "* Performing database cleanup\n"; 329 #$czarDb->cleanupDateRange($yesterday, $yesterday, $config->getCzarCleanupInterval()); 330 #print "* Optimizing the database\n"; 331 #$czarDb->optimize(); 324 332 $lastDayDailyTasks = $yesterday; 325 333 } … … 327 335 328 336 # check nightly science status 329 print "* Checking nightly science status\n"; 330 if (!$pantasks->getNightlyScienceStatus(\$nsStatus,'gpc1')) {$nsStatus = "Unknown";} 331 $czarDb->updateNightlyScience($nsStatus,'gpc1'); 332 if (!$pantasks->getNightlyScienceStatus(\$nsStatus,'gpc2')) {$nsStatus = "Unknown";} 333 $czarDb->updateNightlyScience($nsStatus,'gpc2'); 337 if($dbupdate == 1) { 338 print "* Checking nightly science status\n"; 339 if (!$pantasks->getNightlyScienceStatus(\$nsStatus,'gpc1')) {$nsStatus = "Unknown";} 340 $czarDb->updateNightlyScience($nsStatus,'gpc1'); 341 if (!$pantasks->getNightlyScienceStatus(\$nsStatus,'gpc2')) {$nsStatus = "Unknown";} 342 $czarDb->updateNightlyScience($nsStatus,'gpc2'); 343 } 334 344 335 345 # check nebulous 336 346 print "* Checking Nebulous\n"; 337 $nebulous->updateClusterSpaceInfo();347 if($dbupdate == 1) {$nebulous->updateClusterSpaceInfo();} 338 348 $plotter0->plotStorageTimeSeries($czarDb->subtractInterval($begin, "1 WEEK") , $end); 339 349 $plotter0->plotDiskUsageHistogram(); 340 350 $plotter0->plotDiskUsageHistogramLarge(); 341 updateServerStatus();351 if($dbupdate == 1) {updateServerStatus();} 342 352 343 353 # check pantasks dates 344 updateDates();354 if($dbupdate == 1) {updateDates();} 345 355 346 356 # check labels 347 my ($labels, $labels2) = updateLabels( );357 my ($labels, $labels2) = updateLabels($dbupdate); 348 358 my @labels = @$labels; 349 359 my @labels2 = @$labels2; … … 362 372 my $size = @{$labels}; 363 373 if($size > 0) { 364 updateAllStages($thisServer, $newState, $labels,$labels2, $begin, $end);374 if($dbupdate == 1) {updateAllStages($thisServer, $newState, $labels,$labels2, $begin, $end);} 365 375 if ($thisServer eq "stdscience") { 366 376 createPlots($thisServer, $plotter1, $labels, $begin, $end);
Note:
See TracChangeset
for help on using the changeset viewer.
