Changeset 41125 for trunk/ippMonitor/czartool/czarpoll.pl
- Timestamp:
- Nov 14, 2019, 2:50:20 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/czartool/czarpoll.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/czartool/czarpoll.pl
r40879 r41125 236 236 $pantasks->getServerStatus($server,'gpc2', \$alive, \$running); 237 237 $czarDb->updateServerStatus($server,'gpc2', $alive, $running); 238 } 239 } 240 241 ########################################################################### 242 # 243 # Updates pantasks server status TODO should really get info for all servers at once 244 # 245 ########################################################################### 246 sub updateServerStatusLive { 247 print "* Checking all pantasks servers\n"; 248 249 my $servers = $pantasks->getServerList(); 250 251 my $server = undef; 252 my $alive = undef; 253 my $running = undef; 254 foreach $server (@{$servers}) { 255 $pantasks->getServerStatus($server,'gpc1', \$alive, \$running); 256 $czarDb->updateServerStatusLive($server,'gpc1', $alive, $running); 257 $pantasks->getServerStatus($server,'gpc2', \$alive, \$running); 258 $czarDb->updateServerStatusLive($server,'gpc2', $alive, $running); 238 259 } 239 260 } … … 272 293 my $newDayTime = $config->getMetricsStartTime(); 273 294 my $lastDayDailyTasks = "2010-01-01"; 274 295 my $checkneb = 1; # 1 for nebulous, 0 for localhost test 275 296 # main polling loop 276 297 while (1) { 298 277 299 my $iterationStartTime = time(); 278 300 279 301 #get the time of last czarpoll update 280 302 $polldate = $czarDb->getPollDate(); … … 287 309 if($timediff > 120.) { 288 310 print "There is no recent Czarpoll iteration\n"; 289 print "* Updating database entries*\n";311 print "* Updating database entries*\n"; 290 312 $dbupdate = 1; 291 313 } else { 292 314 print "There is a recent Czarpoll iteration already made ($timediff sec ago)\n"; 293 print "* Skipping database queries and entries*\n";315 print "* Skipping database queries and entries\n"; 294 316 $dbupdate = 0; 295 317 } … … 326 348 #TdB20190703: The ipp113 and ipp117 instances of czarpoll use the same stage DBs in czarDB. 327 349 #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();350 print "* Performing database cleanup\n"; 351 $czarDb->cleanupDateRange($yesterday, $yesterday, $config->getCzarCleanupInterval()); 352 print "* Optimizing the database\n"; 353 $czarDb->optimize(); 332 354 $lastDayDailyTasks = $yesterday; 333 355 } … … 344 366 345 367 # check nebulous 346 print "* Checking Nebulous\n"; 347 if($dbupdate == 1) {$nebulous->updateClusterSpaceInfo();} 348 $plotter0->plotStorageTimeSeries($czarDb->subtractInterval($begin, "1 WEEK") , $end); 349 $plotter0->plotDiskUsageHistogram(); 350 $plotter0->plotDiskUsageHistogramLarge(); 368 if ($checkneb == 1) { 369 print "* Checking Nebulous\n"; 370 if($dbupdate == 1) {$nebulous->updateClusterSpaceInfo();} 371 $plotter0->plotStorageTimeSeries($czarDb->subtractInterval($begin, "1 WEEK") , $end); 372 $plotter0->plotDiskUsageHistogram(); 373 $plotter0->plotDiskUsageHistogramLarge(); 374 } 375 else { 376 print "* Locahost, so no checking nebulous\n"; 377 } 378 379 # check pantasks status 351 380 if($dbupdate == 1) {updateServerStatus();} 381 if($dbupdate == 1) {updateServerStatusLive();} 352 382 353 383 # check pantasks dates
Note:
See TracChangeset
for help on using the changeset viewer.
