Changeset 40840
- Timestamp:
- Jul 23, 2019, 2:24:01 PM (7 years ago)
- Location:
- trunk/ippMonitor
- Files:
-
- 12 edited
-
Makefile.in (modified) (2 diffs)
-
config.dat.in (modified) (2 diffs)
-
czartool/czarconfig.xml.in (modified) (1 diff)
-
czartool/czarpoll.pl (modified) (17 diffs)
-
czartool/czartool.pl (modified) (11 diffs)
-
czartool/czartool/CzarDb.pm (modified) (9 diffs)
-
czartool/czartool/Pantasks.pm (modified) (8 diffs)
-
raw/czartool_getplot.php (modified) (1 diff)
-
raw/czartool_labels.php (modified) (17 diffs)
-
raw/ipp.czar.dat (modified) (2 diffs)
-
raw/ipp.menu.dat (modified) (1 diff)
-
raw/ipp.sky.dat (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/Makefile.in
r40425 r40840 165 165 $(DESTWWW)/warpFailedSkyfiles.php \ 166 166 $(DESTWWW)/failedWarpSkyfiles.php \ 167 $(DESTWWW)/fullforceFailedSkyfile.php \ 168 $(DESTWWW)/fullforceProcessedSkyfile.php \ 169 $(DESTWWW)/fullforceRun.php \ 170 $(DESTWWW)/fullforceSummary.php \ 171 $(DESTWWW)/fullforce_failure.php \ 167 172 $(DESTWWW)/failedFullForceSkyfiles.php \ 168 173 $(DESTWWW)/diffSummary.php \ … … 172 177 $(DESTWWW)/diffProcessedSkyfile.php \ 173 178 $(DESTWWW)/diffProcessedSkyfile_Images.php \ 179 $(DESTWWW)/diffFailedSkyfile.php \ 174 180 $(DESTWWW)/failedDiffSkyfile.php \ 175 181 $(DESTWWW)/stackRun.php \ -
trunk/ippMonitor/config.dat.in
r38208 r40840 1 1 2 // host and user information for the main processing database (contains, e.g., gpc1, gpc2, etc) 2 3 $DBHOST = ""; 3 4 $DBUSER = ""; 4 5 $DBPASS = ""; 6 7 8 // location of nebulous apache interface machine 9 $NEB_SERVER = ""; 10 11 // Czartool configuration variables 12 // NOTE: These should match the configuration file used by the czartool perl modules: czartool/czarconfig.xml 13 $CZARDBNAME = ""; 14 $CZARDBHOST = ""; 15 16 // location of plots produced by czarpoll.pl 17 $CZARPLOTDIR = ""; 5 18 6 19 // Temporary files belonging to DELETION_USER and older than … … 9 22 10 23 $DELETION_USER = ""; 11 $DELETION_DELAY = 15;24 $DELETION_DELAY =5; 12 25 13 $ REPL_HOST_IPPADMIN= "";14 $ REPL_USER_IPPADMIN= "";15 $ REPL_PASSWORD_IPPADMIN= "";16 $ REPL_DBNAME_IPPADMIN = "";26 $HOST_NEBULOUS = ""; 27 $USER_NEBULOUS = ""; 28 $PASSWORD_NEBULOUS = ""; 29 $DBNAME_NEBULOUS = ""; 17 30 18 $REPL_HOST_NEBULOUS = "";19 $REPL_USER_NEBULOUS = "";31 $REPL_HOST_NEBULOUS = ""; 32 $REPL_USER_NEBULOUS = ""; 20 33 $REPL_PASSWORD_NEBULOUS = ""; 21 $REPL_DBNAME_NEBULOUS = "";34 $REPL_DBNAME_NEBULOUS = ""; 22 35 23 $REPL_HOST_PSTAMP = ""; 24 $REPL_USER_PSTAMP = ""; 36 $REPL_HOST_NEBULOUS_SECONDARY = ""; 37 $REPL_USER_NEBULOUS_SECONDARY = ""; 38 $REPL_PASSWORD_NEBULOUS_SECONDARY = ""; 39 $REPL_DBNAME_NEBULOUS_SECONDARY = ""; 40 41 $REPL_HOST_PSTAMP = ""; 42 $REPL_USER_PSTAMP = ""; 25 43 $REPL_PASSWORD_PSTAMP = ""; 26 $REPL_DBNAME_PSTAMP = "";44 $REPL_DBNAME_PSTAMP = ""; 27 45 28 $REPL_HOST_GPC1 = ""; 29 $REPL_USER_GPC1 = ""; 46 $REPL_HOST_ISP = ""; 47 $REPL_USER_ISP = ""; 48 $REPL_PASSWORD_ISP = ""; 49 $REPL_DBNAME_ISP = ""; 50 51 $HOST_GPC1 = ""; 52 $USER_GPC1 = ""; 53 $PASSWORD_GPC1 = ""; 54 $DBNAME_GPC1 = ""; 55 56 $REPL_HOST_GPC1 = ""; 57 $REPL_USER_GPC1 = ""; 30 58 $REPL_PASSWORD_GPC1 = ""; 31 $REPL_DBNAME_GPC1 = "";59 $REPL_DBNAME_GPC1 = ""; 32 60 33 $REPL_HOST_ ISP= "";34 $REPL_USER_ ISP= "";35 $REPL_PASSWORD_ ISP= "";36 $REPL_DBNAME_ ISP= "";61 $REPL_HOST_GPC1_SECONDARY = ""; 62 $REPL_USER_GPC1_SECONDARY = ""; 63 $REPL_PASSWORD_GPC1_SECONDARY = ""; 64 $REPL_DBNAME_GPC1_SECONDARY = ""; 37 65 38 $REPL_HOST_NEBULOUS_SECONDARY = ""; 39 $REPL_USER_NEBULOUS_SECONDARY = ""; 40 $REPL_PASSWORD_NEBULOUS_SECONDARY = ""; 41 $REPL_DBNAME_NEBULOUS_SECONDARY = ""; 66 $REPL_HOST_DATASTORE_SECONDARY = ""; 67 $REPL_USER_DATASTORE_SECONDARY = ""; 68 $REPL_PASSWORD_DATASTORE_SECONDARY = ""; 69 $REPL_DBNAME_DATASTORE_SECONDARY = ""; 70 71 //Important machines that should be checked for accessibiltiy 72 $HOST_GATEWAY = ""; 73 $DBNAME_GATEWAY = ""; 74 75 $HOST_GATEWAY_SECONDARY = ""; 76 $DBNAME_GATEWAY_SECONDARY = ""; 77 78 $HOST_APACHE1 = ""; 79 $DBNAME_APACHE1 = ""; 80 81 $HOST_APACHE2 = ""; 82 $DBNAME_APACHE2 = ""; 83 84 $HOST_APACHE3 = ""; 85 $DBNAME_APACHE3 = ""; 86 87 $HOST_APACHE4 = ""; 88 $DBNAME_APACHE4 = ""; 89 90 $HOST_APACHE5 = ""; 91 $DBNAME_APACHE5 = ""; 92 93 $HOST_APACHE6 = ""; 94 $DBNAME_APACHE6 = ""; 95 96 $HOST_PROXY = ""; 97 $DBNAME_PROXY = ""; 98 99 $HOST_SVN = ""; 100 $DBNAME_SVN = ""; 101 102 $HOST_CONFLUENCE = ""; 103 $DBNAME_CONFLUENCE = ""; 104 105 -
trunk/ippMonitor/czartool/czarconfig.xml.in
r40090 r40840 10 10 <size>8</size> 11 11 <path>PATH/TO/czartool_plots</path> 12 <exec>PATH/TO/gnuplot</exec> 12 13 </gnuplot> 13 14 -
trunk/ippMonitor/czartool/czarpoll.pl
r40834 r40840 102 102 foreach $server (@servers) { 103 103 104 my @dates = @{$pantasks->getDates($server )};104 my @dates = @{$pantasks->getDates($server,'gpc1')}; 105 105 if (@dates) { 106 107 $czarDb->updateServerDates($server, \@dates); 106 $czarDb->updateServerDates($server, \@dates,'gpc1'); 108 107 } 109 108 else { 110 111 print "WARNING: No dates to update for '$server'\n"; 109 print "WARNING: No dates to update for '$server' in gpc1\n"; 110 } 111 112 my @dates2 = @{$pantasks->getDates($server,'gpc2')}; 113 if (@dates2) { 114 $czarDb->updateServerDates($server, \@dates2,'gpc2'); 115 } 116 else { 117 print "WARNING: No dates to update for '$server' in gpc2\n"; 112 118 } 113 119 } … … 126 132 127 133 print "* Updating labels\n"; 128 # my @servers = ("stdscience", "distribution", "publishing", "update");129 134 my @servers = ("stdscience", "distribution"); 130 135 131 136 my @allLabels = (); 132 137 my @allLabels2 = (); 138 my @fields = (); 139 140 #first grab the labels fom the relevant pantasks 133 141 my $server = undef; 134 142 foreach $server (@servers) { 135 my @labels = @{$pantasks->getLabels($server )};143 my @labels = @{$pantasks->getLabels($server,'gpc1')}; 136 144 push (@allLabels, @labels); 137 } 145 146 my @labels2 = @{$pantasks->getLabels($server,'gpc2')}; 147 push (@allLabels2, @labels2); 148 } 149 150 ## adding extra labels from external file 151 my $filename = 'extra_labels.dat'; 152 if (open(my $fh, '<:encoding(UTF-8)', $filename)) { 153 my $header = <$fh>; 154 $header = <$fh>; 155 while (my $row = <$fh>) { 156 chomp $row; 157 @fields = split(' ', $row); 158 if ($fields[1] eq 'gpc1') { 159 push (@allLabels, $fields[0]); 160 } 161 if ($fields[1] eq 'gpc2') { 162 push (@allLabels2, $fields[0]); 163 } 164 } 165 } else { 166 warn "No extra labels found in '$filename' $!"; 167 } 168 169 # Now, grab the priorities for each label 170 my @priorities = (); 171 my $row = undef; 172 my $label = undef; 173 my $priority = undef; 174 foreach $label ( @allLabels ) { 175 $priority = $gpc1Db->getPriority($label); 176 push(@priorities, $priority); 177 } 178 179 #also grab gpc2 priorities from the gpc2 Label table 180 my @priorities2 = (); 181 my $priority2 = undef; 182 foreach $label ( @allLabels2 ) { 183 $priority2 = $gpc2Db->getPriority($label); 184 push(@priorities2, $priority2); 185 } 186 187 #sort labels by priority 188 my @idx = sort {$priorities[$a] <=> $priorities[$b]} 0 ..$#priorities; 189 @allLabels = @allLabels[@idx]; 190 @priorities = @priorities[@idx]; 191 192 my @idx2 = sort {$priorities2[$a] <=> $priorities2[$b]} 0 ..$#priorities2; 193 @allLabels2 = @allLabels2[@idx2]; 194 @priorities2 = @priorities2[@idx2]; 138 195 139 196 # store them all in stdscience: 140 197 $server = "stdscience"; 141 198 if (@allLabels) { 142 $czarDb->updateCurrentLabels($server, \@allLabels );199 $czarDb->updateCurrentLabels($server, \@allLabels,'gpc1', \@priorities); 143 200 } else { 144 print "WARNING: No labels to update for '$server'\n"; 145 } 201 print "WARNING: No labels to update for gpc1 for '$server'\n"; 202 } 203 204 if (@allLabels2) { 205 $czarDb->updateCurrentLabels($server, \@allLabels2,'gpc2', \@priorities2); 206 } else { 207 print "WARNING: No labels to update for gpc2 for '$server'\n"; 208 } 209 return(\@allLabels,\@allLabels2); 146 210 } 147 211 … … 160 224 my $running = undef; 161 225 foreach $server (@{$servers}) { 162 163 $pantasks->getServerStatus($server, \$alive, \$running); 164 $czarDb->updateServerStatus($server, $alive, $running); 165 } 226 $pantasks->getServerStatus($server,'gpc1', \$alive, \$running); 227 $czarDb->updateServerStatus($server,'gpc1', $alive, $running); 228 $pantasks->getServerStatus($server,'gpc2', \$alive, \$running); 229 $czarDb->updateServerStatus($server,'gpc2', $alive, $running); 230 } 166 231 } 167 232 … … 182 247 my $str = undef; 183 248 my $labels = undef; 249 my $labels2 = undef; 184 250 my $updateLabels = undef; 185 251 my $row = undef; … … 187 253 my $end = undef; 188 254 my $priority = undef; 255 my $priority2 = undef; 189 256 my $newState = undef; 190 257 my $nsStatus = undef; … … 227 294 228 295 # now cleanup tables from yesterday and optimize 229 print "* Performing database cleanup\n"; 230 $czarDb->cleanupDateRange($yesterday, $yesterday, $config->getCzarCleanupInterval()); 231 print "* Optimizing the database\n"; 232 $czarDb->optimize(); 296 #TdB20190703: The ipp113 and ipp117 instances of czarpoll use the same stage DBs in czarDB. 297 #Therefore, it makes no sense to run the cleanup+optimising twice 298 #print "* Performing database cleanup\n"; 299 #$czarDb->cleanupDateRange($yesterday, $yesterday, $config->getCzarCleanupInterval()); 300 #print "* Optimizing the database\n"; 301 #$czarDb->optimize(); 233 302 $lastDayDailyTasks = $yesterday; 234 303 } … … 237 306 # check nightly science status 238 307 print "* Checking nightly science status\n"; 239 if (!$pantasks->getNightlyScienceStatus(\$nsStatus)) {$nsStatus = "Unknown";} 240 $czarDb->updateNightlyScience($nsStatus); 308 if (!$pantasks->getNightlyScienceStatus(\$nsStatus,'gpc1')) {$nsStatus = "Unknown";} 309 $czarDb->updateNightlyScience($nsStatus,'gpc1'); 310 if (!$pantasks->getNightlyScienceStatus(\$nsStatus,'gpc2')) {$nsStatus = "Unknown";} 311 $czarDb->updateNightlyScience($nsStatus,'gpc2'); 241 312 242 313 # check nebulous … … 252 323 253 324 # check labels 254 updateLabels(); 325 my ($labels, $labels2) = updateLabels(); 326 my @labels = @$labels; 327 my @labels2 = @$labels2; 255 328 256 329 # servers to check … … 265 338 266 339 # deal with stdscience labels 267 if (!$czarDb->getCurrentLabels($thisServer, \$labels)) {next;}268 340 my $size = @{$labels}; 269 341 if($size > 0) { 270 271 # get priority 272 foreach $row ( @{$labels} ) { 273 my ($label) = @{$row}; 274 # for now use priorities from gpc1 database 275 $priority = $gpc1Db->getPriority($label); 276 $czarDb->setLabelPriority($label, $priority); 277 } 278 279 updateAllStages($thisServer, $newState, $labels, $begin, $end); 342 updateAllStages($thisServer, $newState, $labels,$labels2, $begin, $end); 280 343 if ($thisServer eq "stdscience") { 281 344 createPlots($thisServer, $plotter1, $labels, $begin, $end); 282 createPlots($thisServer, $plotter2, $labels , $begin, $end);345 createPlots($thisServer, $plotter2, $labels2, $begin, $end); 283 346 } 284 347 } … … 376 439 # # $plotter->createTimeSeries($label, undef, $begin, $end, 1, 1, 1); 377 440 378 # #TdB 20190411: Make the all stages plots for the nightlyscience labels only379 441 # if ($label =~ m/nightlyscience/) { 380 442 # $plotter->createTimeSeries($label, undef, $begin, $end, 1, 0, 1); … … 382 444 #} 383 445 384 $allServerLabels = "all_".$server."_labels"; 385 386 $plotter->createTimeSeries($allServerLabels, undef, $begin, $end, 1, 0, 1); 387 388 #TdB 20190411: We are turning off these plots for the time being. They take up a lot of time and are rarely looked at. If need be, can be generated on the fly using czartool. 446 $allServerLabels = $server."_labels"; 447 448 $plotter->createTimeSeries($allServerLabels, undef, $begin, $end, 1, 1, 1); 449 389 450 foreach $stage (@stages) { 390 $plotter->createTimeSeries($allServerLabels, $stage, $begin, $end, 1, 0, 1); # TODO must be a neater way...451 $plotter->createTimeSeries($allServerLabels, $stage, $begin, $end, 1, 0, 0); # TODO must be a neater way... 391 452 } 392 453 } … … 398 459 ########################################################################### 399 460 sub updateAllStages { 400 my ($labelServer, $newState, $rows, $ begin, $end) = @_;461 my ($labelServer, $newState, $rows, $rows2, $begin, $end) = @_; 401 462 402 463 print "* Updating stage data\n"; … … 419 480 foreach $stage (@stages) { 420 481 $server = $pantasks->getServerForThisStage($stage); 421 $pantasks->getRevertStatus($stage, \$reverting); 422 $czarDb->updateRevertStatus($stage, $reverting); 482 $pantasks->getRevertStatus($stage,'gpc1', \$reverting); 483 $czarDb->updateRevertStatus($stage,'gpc1', $reverting); 484 485 $pantasks->getRevertStatus($stage,'gpc2', \$reverting); 486 $czarDb->updateRevertStatus($stage,'gpc2', $reverting); 423 487 424 488 print "* Checking labels for $stage stage\n"; … … 427 491 if (($stage eq 'summitExp')||($stage eq 'downloadExp')||($stage eq 'newExp')||($stage eq 'rawExp')) { 428 492 ($new,$full,$faults) = $gpc1Db->countRawExposures($today,$stage); 429 $czarDb->insertNewTimeData($stage, "all_".$labelServer."_labels", 'gpc1', $new, $full, $faults);493 $czarDb->insertNewTimeData($stage, $labelServer."_labels", 'gpc1', $new, $full, $faults); 430 494 431 495 ($new,$full,$faults) = $gpc2Db->countRawExposures($today,$stage); 432 $czarDb->insertNewTimeData($stage, "all_".$labelServer."_labels", 'gpc2', $new, $full, $faults);496 $czarDb->insertNewTimeData($stage, $labelServer."_labels", 'gpc2', $new, $full, $faults); 433 497 434 498 next; 435 499 } 436 500 437 501 #count the number of exposures under each label, and their faults 438 502 $totalNew1=$totalFaults1=$totalFull1=0; 439 $totalNew2=$totalFaults2=$totalFull2=0;440 503 foreach $row ( @{$rows} ) { 441 my ($label) = @{$row};504 my ($label) = $row; 442 505 443 506 chomp($label); … … 447 510 $full = $gpc1Db->countExposures($label, $stage, "full"); 448 511 $faults = $gpc1Db->countFaults($label, $stage, $newState); 449 #printf("%s %s, %s, %d, %d\n", $labelServer, $label, $stage, $new, $faults);450 512 $totalNew1 += $new; 451 513 $totalFull1 += $full; … … 453 515 454 516 $czarDb->insertNewTimeData($stage, $label, 'gpc1', $new, $full, $faults); 455 517 } 518 519 $totalNew2=$totalFaults2=$totalFull2=0; 520 foreach $row ( @{$rows2} ) { 521 my ($label) = $row; 522 523 chomp($label); 524 525 # Move this to a function and pass in the database 456 526 $new = $gpc2Db->countExposures($label, $stage, $newState); 457 527 $full = $gpc2Db->countExposures($label, $stage, "full"); 458 528 $faults = $gpc2Db->countFaults($label, $stage, $newState); 459 #printf("%s %s, %s, %d, %d\n", $labelServer, $label, $stage, $new, $faults);460 529 $totalNew2 += $new; 461 530 $totalFull2 += $full; … … 465 534 } 466 535 467 $czarDb->insertNewTimeData($stage, "all_".$labelServer."_labels", 'gpc1', $totalNew1, $totalFull1, $totalFaults1);468 $czarDb->insertNewTimeData($stage, "all_".$labelServer."_labels", 'gpc2', $totalNew2, $totalFull2, $totalFaults2);469 } 470 } 471 536 $czarDb->insertNewTimeData($stage, $labelServer."_labels", 'gpc1', $totalNew1, $totalFull1, $totalFaults1); 537 $czarDb->insertNewTimeData($stage, $labelServer."_labels", 'gpc2', $totalNew2, $totalFull2, $totalFaults2); 538 } 539 } 540 -
trunk/ippMonitor/czartool/czartool.pl
r38206 r40840 15 15 my $save_temps = 1; 16 16 my $interval = undef; 17 my $telescope = "gpc1"; 17 18 18 19 GetOptions ( 19 20 "dbname|d=s" => \$czarDbName, 20 21 "interval|i=s" => \$interval, 22 "telescope|t=s" => \$telescope, 21 23 ); 22 23 24 24 25 my @states = ("full", "new", "drop", "wait"); … … 26 27 my $czarDb = $config->getCzarDbInstance(); 27 28 my $gpc1Db = $config->getGpc1Instance(); 29 my $gpc2Db = $config->getGpc2Instance(); 28 30 my $pantasks = new czartool::Pantasks(); 29 31 … … 55 57 sub promptPoll { 56 58 57 @stdscienceLabels = @{$pantasks->getLabels("stdscience" )};58 @distributionLabels = @{$pantasks->getLabels("distribution" )};59 # @publishingLabels = @{$pantasks->getLabels("publishing" )};59 @stdscienceLabels = @{$pantasks->getLabels("stdscience",$telescope)}; 60 @distributionLabels = @{$pantasks->getLabels("distribution",$telescope)}; 61 # @publishingLabels = @{$pantasks->getLabels("publishing", $telescope)}; 60 62 @publishingLabels = @stdscienceLabels; 61 checkAllLabels("new" );63 checkAllLabels("new", $telescope); 62 64 printInstructions(); 63 65 … … 68 70 69 71 if ($key eq "s") {checkServers();} 70 elsif ($key eq "l") {checkAllLabels("new" );}71 elsif ($key eq "u") {$pantasks->getServerCurrentStatus("stdscience" );}72 elsif ($key =~ m/[0-9]/) {my $key2=getc; checkOneLabel($stdscienceLabels[($key.$key2)-1] );}72 elsif ($key eq "l") {checkAllLabels("new", $telescope);} 73 elsif ($key eq "u") {$pantasks->getServerCurrentStatus("stdscience",$telescope);} 74 elsif ($key =~ m/[0-9]/) {my $key2=getc; checkOneLabel($stdscienceLabels[($key.$key2)-1], $telescope);} 73 75 printInstructions(); 74 76 … … 139 141 ########################################################################### 140 142 sub labelDetails { 143 my ($telescope) = @_; 141 144 142 145 print "\nPlease enter the label name, or number from table above: "; … … 144 147 chomp($input); 145 148 if ($input =~ m/^([0-9]|[1-9][0-9]|[1-9][0-9][0-9])$/) { 146 return checkOneLabel($stdscienceLabels[$input] );147 } 148 149 checkOneLabel($input );149 return checkOneLabel($stdscienceLabels[$input], $telescope); 150 } 151 152 checkOneLabel($input, $telescope); 150 153 } 151 154 … … 156 159 ########################################################################### 157 160 sub checkOneLabel { 158 my ($label ) = @_;161 my ($label, $telescope) = @_; 159 162 160 163 chomp($label); … … 188 191 foreach $stage (@stages) { 189 192 190 printf("|%14s", getStateAndFaultsString($label, $state, $stage ));193 printf("|%14s", getStateAndFaultsString($label, $state, $stage, $telescope)); 191 194 } 192 195 … … 209 212 ########################################################################### 210 213 sub checkAllLabels { 211 my ($state ) = @_;214 my ($state, $telescope) = @_; 212 215 #print time, $/; 213 216 my $stage; … … 259 262 foreach $stage (@stages) { 260 263 261 printf("|%14s", getStateAndFaultsString($stdsLabel, $state, $stage ));264 printf("|%14s", getStateAndFaultsString($stdsLabel, $state, $stage, $telescope)); 262 265 } 263 266 … … 280 283 ########################################################################### 281 284 sub getStateAndFaultsString { 282 my ($label, $state, $stage) = @_; 283 284 my $new = $gpc1Db->countExposures($label, $stage, $state); 285 286 #if ($state ne "new") {return $new;} 287 288 my $faults = $gpc1Db->countFaults($label, $stage, $state); 285 my ($label, $state, $stage, $telescope) = @_; 286 287 my $new = undef; 288 my $faults = undef; 289 290 if ($telescope eq 'gpc1') { 291 $new = $gpc1Db->countExposures($label, $stage, $state); 292 #if ($state ne "new") {return $new;} 293 294 $faults = $gpc1Db->countFaults($label, $stage, $state); 295 } 296 elsif ($telescope eq 'gpc2') { 297 $new = $gpc2Db->countExposures($label, $stage, $state); 298 #if ($state ne "new") {return $new;} 299 300 $faults = $gpc2Db->countFaults($label, $stage, $state); 301 } 302 else { 303 print "WARNING: Must specify a telescope for connecting to the right pantask\n"; 304 } 289 305 290 306 if ($faults < 1) {return $new;} -
trunk/ippMonitor/czartool/czartool/CzarDb.pm
r40702 r40840 137 137 ########################################################################### 138 138 sub updateServerStatus { 139 my ($self, $server, $alive, $running) = @_;140 141 my $query = $self->{_db}->prepare(<<SQL); 142 INSERT INTO s ervers143 (server, alive, running)139 my ($self, $server,$telescope, $alive, $running) = @_; 140 141 my $query = $self->{_db}->prepare(<<SQL); 142 INSERT INTO science_servers 143 (server,telescope, alive, running) 144 144 VALUES 145 ('$server', $alive, $running);145 ('$server','$telescope', $alive, $running); 146 146 SQL 147 147 … … 173 173 ########################################################################### 174 174 sub updateRevertStatus { 175 my ($self, $stage, $reverting) = @_;176 177 my $query = $self->{_db}->prepare(<<SQL); 178 UPDATE reverts175 my ($self, $stage,$telescope, $reverting) = @_; 176 177 my $query = $self->{_db}->prepare(<<SQL); 178 UPDATE science_reverts 179 179 SET reverting = $reverting 180 WHERE stage LIKE '$stage'; 181 SQL 182 183 $query->execute; 184 } 185 186 ########################################################################### 187 # 188 # Sets priority for this label 189 # 190 ########################################################################### 191 sub setLabelPriority { 192 my ($self, $label, $priority) = @_; 193 194 my $query = $self->{_db}->prepare(<<SQL); 195 UPDATE current_labels 196 SET priority = $priority 197 WHERE label LIKE '$label' 198 AND server LIKE 'stdscience'; 180 WHERE stage LIKE '$stage' AND telescope LIKE '$telescope'; 199 181 SQL 200 182 … … 211 193 212 194 my $query = $self->{_db}->prepare(<<SQL); 213 DELETE FROM server_dates; 195 DELETE FROM science_server_dates; 196 214 197 SQL 215 198 … … 223 206 ########################################################################### 224 207 sub updateServerDates { 225 my ($self, $server, $dates ) = @_;208 my ($self, $server, $dates,$telescope) = @_; 226 209 227 210 my $size = scalar @{$dates}; … … 233 216 234 217 my $query = $self->{_db}->prepare(<<SQL); 235 INSERT INTO s erver_dates236 (server, date)218 INSERT INTO science_server_dates 219 (server, telescope, date) 237 220 VALUES 238 ('$server', '$date');221 ('$server','$telescope', '$date'); 239 222 SQL 240 223 … … 249 232 ########################################################################### 250 233 sub updateNightlyScience { 251 my ($self, $status ) = @_;252 253 my $query = $self->{_db}->prepare(<<SQL); 254 DELETE FROM nightlyscience;234 my ($self, $status,$telescope) = @_; 235 236 my $query = $self->{_db}->prepare(<<SQL); 237 DELETE FROM science_nightlyscience WHERE telescope LIKE '$telescope'; 255 238 SQL 256 239 … … 258 241 259 242 $query = $self->{_db}->prepare(<<SQL); 260 INSERT INTO nightlyscience261 (status )243 INSERT INTO science_nightlyscience 244 (status, telescope) 262 245 VALUES 263 ('$status' );246 ('$status', '$telescope'); 264 247 SQL 265 248 … … 269 252 ########################################################################### 270 253 # 271 # Updates current_labels table254 # Updates science_labels table 272 255 # 273 256 ########################################################################### 274 257 sub updateCurrentLabels { 275 my ($self, $server, $labels ) = @_;258 my ($self, $server, $labels, $telescope,$priorities) = @_; 276 259 277 260 my $size = scalar @{$labels}; 278 261 if ($size < 1) { return; } 279 if ($server eq 'stdscience') {262 # if (($server eq 'stdscience') && ($telescope eq 'gpc1')) { 280 263 ## EAM 20180510 : manually adding label used for Pole reprocessing 281 264 ## I would like to add an external file to manage these extra 282 265 ## labels, but this suffices for now 283 push @{$labels}, 'PV3.Pole.Reprocess.20180510'; 284 push @{$labels}, 'ps_ud_QUB'; 285 } 286 287 my $query = $self->{_db}->prepare(<<SQL); 288 DELETE FROM current_labels WHERE server LIKE '$server'; 266 # push @{$labels}, 'PV3.Pole.Reprocess.20180510'; 267 # push @{$labels}, 'ps_ud_QUB'; 268 # push @{priorities}, 50000; 269 # push @{priorities}, 415; 270 # } 271 272 my $query = $self->{_db}->prepare(<<SQL); 273 DELETE FROM science_labels WHERE server LIKE '$server' AND telescope LIKE '$telescope'; 289 274 SQL 290 275 … … 292 277 293 278 my $label = undef; 294 295 foreach $label (@{$labels}) { 279 my $priority = undef; 280 281 foreach my $i (0 .. $#$labels) { 282 $label = @{$labels}[$i]; 283 $priority = @{$priorities}[$i]; 296 284 297 285 my $query = $self->{_db}->prepare(<<SQL); 298 INSERT INTO current_labels299 (server, label )286 INSERT INTO science_labels 287 (server, label,telescope,priority) 300 288 VALUES 301 ('$server', '$label' );289 ('$server', '$label','$telescope',$priority); 302 290 SQL 303 291 -
trunk/ippMonitor/czartool/czartool/Pantasks.pm
r40085 r40840 24 24 ); 25 25 26 my $ipphome = "/data/ippc64.1/ippitc";27 28 26 ########################################################################### 29 27 # … … 86 84 ########################################################################### 87 85 sub getNightlyScienceStatus { 88 my ($self, $status ) = @_;86 my ($self, $status,$telescope) = @_; 89 87 90 88 my @labels; 89 my $ipphome; 90 91 if ($telescope eq 'gpc1') { 92 $ipphome = "/data/ippc64.1/ippitc"; 93 } 94 elsif ($telescope eq 'gpc2') { 95 $ipphome = "/data/ippc18.0/home/ippps2"; 96 } 97 else { 98 print "WARNING: Must specify a telescope for connecting to the right pantask\n"; 99 } 91 100 92 101 my ($day, $month, $year) = (localtime)[3,4,5]; … … 102 111 if ($line =~ m/$today\s+(.+)/) { 103 112 ${$status} = $1; 113 if (${$status} =~ m/ $telescope/) { 114 ${$status} = $`; 115 } 116 104 117 return 1; 105 118 } … … 111 124 ########################################################################### 112 125 # 113 # Gets labels for provided server 126 # Gets labels for provided server for gpc1 114 127 # 115 128 ########################################################################### 116 129 sub getLabels { 117 my ($self, $server ) = @_;130 my ($self, $server,$telescope) = @_; 118 131 119 132 my @labels; 120 121 # print "stdscience : $ipphome/$server/ptolemy.rc\n"; 133 my $ipphome; 134 135 if ($telescope eq 'gpc1') { 136 $ipphome = "/data/ippc64.1/ippitc"; 137 } 138 elsif ($telescope eq 'gpc2') { 139 $ipphome = "/data/ippc18.0/home/ippps2"; 140 } 141 else { 142 print "WARNING: Must specify a telescope for connecting to the right pantask\n"; 143 } 144 122 145 my @cmdOut = `echo "show.labels;quit" | pantasks_client -c $ipphome/$server/ptolemy.rc 2>&1`; 123 146 my $line; … … 149 172 ########################################################################### 150 173 sub getServerStatus { 151 my ($self, $server, $alive, $running) = @_; 174 my ($self, $server,$telescope, $alive, $running) = @_; 175 176 my $ipphome; 177 178 if ($telescope eq 'gpc1') { 179 $ipphome = "/data/ippc64.1/ippitc"; 180 } 181 elsif ($telescope eq 'gpc2') { 182 $ipphome = "/data/ippc18.0/home/ippps2"; 183 } 184 else { 185 print "WARNING: Must specify a telescope for connecting to the right pantask\n"; 186 } 152 187 153 188 my @cmdOut = `echo "status ; quit" | pantasks_client -c $ipphome/$server/ptolemy.rc 2>&1`; … … 170 205 ########################################################################### 171 206 sub getServerCurrentStatus { 172 my ($self, $server) = @_; 207 my ($self, $server,$telescope) = @_; 208 209 my $ipphome; 210 if ($telescope eq 'gpc1') { 211 $ipphome = "/data/ippc64.1/ippitc"; 212 } 213 elsif ($telescope eq 'gpc2') { 214 $ipphome = "/data/ippc18.0/home/ippps2"; 215 } 216 else { 217 print "WARNING: Must specify a telescope for connecting to the right pantask\n"; 218 } 173 219 174 220 my @cmdOut = `echo "status;quit" | pantasks_client -c $ipphome/$server/ptolemy.rc 2>&1`; … … 189 235 ########################################################################### 190 236 sub getRevertStatus { 191 my ($self, $stage, $reverting) = @_; 237 my ($self, $stage,$telescope, $reverting) = @_; 238 239 my $ipphome; 240 if ($telescope eq 'gpc1') { 241 $ipphome = "/data/ippc64.1/ippitc"; 242 } 243 elsif ($telescope eq 'gpc2') { 244 $ipphome = "/data/ippc18.0/home/ippps2"; 245 } 246 else { 247 print "WARNING: Must specify a telescope for connecting to the right pantask\n"; 248 } 192 249 193 250 my $server = $self->getServerForThisStage($stage); … … 214 271 ########################################################################### 215 272 sub getDates { 216 my ($self, $server ) = @_;273 my ($self, $server,$telescope) = @_; 217 274 218 275 my @dates; 219 276 220 277 my $prefix; 278 my $ipphome; 279 280 if ($telescope eq 'gpc1') { 281 $ipphome = "/data/ippc64.1/ippitc"; 282 } 283 elsif ($telescope eq 'gpc2') { 284 $ipphome = "/data/ippc18.0/home/ippps2"; 285 } 286 else { 287 print "WARNING: Must specify a telescope for connecting to the right pantask\n"; 288 } 221 289 222 290 if ($server eq "stdscience") {$prefix = "ns";} -
trunk/ippMonitor/raw/czartool_getplot.php
r38258 r40840 22 22 $path = $CZARPLOTDIR; 23 23 24 if ($label == "all") $label = "all_".$mode."_labels";24 if ($label == "all") $label = $mode."_labels"; 25 25 26 26 if ($type=="t" || $type=="r" || $type=="rt" || $type=="rh") -
trunk/ippMonitor/raw/czartool_labels.php
r40427 r40840 90 90 # "publishing", 91 91 "registration", 92 "replication",93 92 "stack", 94 93 # "deepstack", … … 139 138 140 139 // $labels is generated with sequential integer key values 141 $labels = getLabels($czardb, $ selectedMode);142 $distLabelsIndex = getLabels($czardb, "distribution");140 $labels = getLabels($czardb, $proj, $selectedMode); 141 $distLabelsIndex = getLabels($czardb, $proj, "distribution"); 143 142 for ($i = 0; $i < count($distLabelsIndex); $i++) { 144 143 $distLabelsExist[$distLabelsIndex[$i]] = true; … … 195 194 echo "<td style=width:100px;text-align:top;\">"; 196 195 # time series plot 197 echo "<br><img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=$plotType\"><br>"; 196 echo "<br><img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br>"; 197 # log time series plot 198 echo "<br><img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=log\"><br>"; 198 199 # rate time series plot 199 200 echo "<br><img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br>"; 200 # rate stacked histo plot201 # echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rh&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br>";202 201 # histogram plot 203 202 # echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=h&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br>"; … … 218 217 219 218 // status table at top 220 $nsStatus = getNightlyScienceStatus($czardb );219 $nsStatus = getNightlyScienceStatus($czardb, $proj); 221 220 $plotTypeLink = ($plotType == "linear") ? "log" : "linear"; 222 221 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink"; … … 232 231 echo "<tr><td>Documentation</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\"><font color=\"blue\">here</font></a></td></tr>"; 233 232 echo "<tr><td>Cluster load</td><td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&hc=6&c=IPP%2520Production\"><font color=\"blue\">here</font></a> <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?m=cpu_report&r=hour&s=by%2520name&c=IPP+Production&h=&sh=1&hc=8&z=small\"><font color=\"blue\">cpu_report</font></a> <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?m=mem_report&r=hour&s=by%2520name&c=IPP+Production&h=&sh=1&hc=8&z=small\"><font color=\"blue\">mem_report</font></a></td></tr>"; 234 echo "<tr><td>Who's using the cluster?</td><td><a href=\"http://ippmonitor.ipp.ifa.hawaii.edu/ippMonitor/clusterMonitor/index.php\"><font color=\"blue\">here</font></a></td></tr>"; 235 echo "<tr><td>Files monitor</td><td><a href=\"http://ippmonitor.ipp.ifa.hawaii.edu/diskMonitor\"><font color=\"blue\">here</font></a></td></tr>"; 236 echo "<tr><td>IPP metrics</td><td><a href=\"http://ipp0022.ifa.hawaii.edu/ps1sc/ippMetrics\"><font color=\"blue\">here</font></a></td></tr>"; 237 echo "<tr><td>Czar log pages</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PS1_IPP_CzarLogs\"><font color=\"blue\">All</font></a> "; 238 echo "<a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PS1_IPP_Czarlog_".(date("Ymd")-date("w")+"1")."\">This week</a>"; 239 echo "</td></tr>"; 233 echo "<tr><td>IPP metrics</td><td><a href=\"https://ps1wiki.ifa.hawaii.edu/data/metrics/index.html\"><font color=\"blue\">here</font></a></td></tr>"; 234 echo "<tr><td>Czar log pages</td><td><a href=\"https://confluence.ipp.ifa.hawaii.edu/pages/viewrecentblogposts.action?key=IPPCZAR\"><font color=\"blue\">here</font></a></td></tr>"; 240 235 echo "<tr><td>Exposure summary</td><td><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\"><font color=\"blue\">here</font></a></td></tr>"; 236 echo "<tr><td>Confluence</td><td><a href=\"https://confluence.ipp.ifa.hawaii.edu/display/IPPCZAR/IPP-Czaring+Home\"><font color=\"blue\">here</font></a></td></tr>"; 237 echo "<tr><td>JIRA</td><td><a href=\"https://jira.ipp.ifa.hawaii.edu/secure/Dashboard.jspa\"><font color=\"blue\">here</font></a></td></tr>"; 241 238 242 239 $plotTypeLink = ($plotType == "linear") ? "log" : "linear"; … … 266 263 createServersTable($pass, $proj,$selectedMode,$czardb, $servers, $selectedLabel, $selectedStage, $plotType); echo "<br>"; 267 264 createSummitDataTable($projectdb); echo "<br>"; // this is slow because of the join between summitExp and rawExp 268 create DatesTable($czardb); echo "<br>";269 270 # This is awful 265 createChunkDataTable($projectdb); echo "<br>"; 266 createDatesTable($czardb, $proj); echo "<br>"; 267 271 268 echo $table; 272 269 echo "<tr>"; 273 createTableTitle("Database replicationstatus (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)", 2);270 createTableTitle("Database status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)", 2); 274 271 275 272 echo "<tr>"; 276 273 createTableColumnHeader("Database"); 277 274 createTableColumnHeader("Status (sec behind master)"); 275 showDatabaseStatus($HOST_GPC1, $USER_GPC1, $PASSWORD_GPC1, $DBNAME_GPC1); 278 276 showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1); 279 277 showReplicationsStatus($REPL_HOST_GPC1_SECONDARY, $REPL_USER_GPC1_SECONDARY, $REPL_PASSWORD_GPC1_SECONDARY, $REPL_DBNAME_GPC1_SECONDARY); 280 278 279 echo "<tr>"; 280 281 showDatabaseStatus($HOST_NEBULOUS, $USER_NEBULOUS, $PASSWORD_NEBULOUS, $DBNAME_NEBULOUS); 281 282 showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS); 282 283 showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_DBNAME_NEBULOUS_SECONDARY); 284 showReplicationsStatus($REPL_HOST_DATASTORE_SECONDARY, $REPL_USER_DATASTORE_SECONDARY, $REPL_PASSWORD_DATASTORE_SECONDARY, $REPL_DBNAME_DATASTORE_SECONDARY); 283 285 284 286 # some mysql replication slaves to add when they are returned to service 285 287 # showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP); 286 # showReplicationsStatus($REPL_HOST_IPPADMIN, $REPL_USER_IPPADMIN, $REPL_PASSWORD_IPPADMIN, $REPL_DBNAME_IPPADMIN); --- this one is in GPC1287 288 # showReplicationsStatus($REPL_HOST_ISP, $REPL_USER_ISP, $REPL_PASSWORD_ISP, $REPL_DBNAME_ISP); 288 289 echo "</table>"; 290 291 echo $table; 292 echo "<tr>"; 293 createTableTitle("Critical machine status", 2); 294 295 echo "<tr>"; 296 createTableColumnHeader("Hostname"); 297 createTableColumnHeader("Status"); 298 showPingStatus($HOST_GATEWAY, $DBNAME_GATEWAY); 299 showPingStatus($HOST_GATEWAY_SECONDARY, $DBNAME_GATEWAY_SECONDARY); 300 301 # showPingStatus($HOST_APACHE1, $DBNAME_APACHE1); 302 showPingStatus($HOST_APACHE2, $DBNAME_APACHE2); 303 showPingStatus($HOST_APACHE3, $DBNAME_APACHE3); 304 showPingStatus($HOST_APACHE4, $DBNAME_APACHE4); 305 showPingStatus($HOST_APACHE5, $DBNAME_APACHE5); 306 showPingStatus($HOST_APACHE6, $DBNAME_APACHE6); 307 showPingStatus($HOST_PROXY, $DBNAME_PROXY); 308 showPingStatus($HOST_SVN, $DBNAME_SVN); 309 showPingStatus($HOST_CONFLUENCE, $DBNAME_CONFLUENCE); 310 311 echo "</table>"; 312 289 313 echo "</table>"; 290 314 menu_end(); … … 401 425 ########################################################################### 402 426 # 427 # Creates a table of chunk progress 428 # 429 ########################################################################### 430 function createChunkDataTable($projectdb) { 431 432 #First find the reference exposure ID to speed up the subsequent queries 433 $date = gmdate("Y-m-d"); 434 $sql = "SELECT MAX(exp_id) FROM rawExp WHERE dateobs >= date_sub('$date', interval 20 day) AND dateobs <= date_sub('$date', interval 10 day)"; 435 $qry = $projectdb->query($sql); 436 if (dberror($qry)) { 437 print "*** WARNING: no data in period 10-20 days before requested date (query will be slower) **\n"; 438 $refExpID = 0; 439 } 440 $qry->fetchInto($refExpID); 441 442 #Find the number of chunks 443 $query = "SELECT groupchunk.chunk,groupchunk.Nquad_firstvisit,group4.Nquad_fourvisits FROM"; 444 $query .= " ("; 445 $query .= " SELECT dateobs,comment,substr(comment, 1, position(' ' in comment)) AS chunk,count(distinct(comment)) AS Nquad_firstvisit"; 446 $query .= " FROM rawExp"; 447 $query .= " WHERE dateobs LIKE '$date%' AND exp_id > $refExpID[0]"; 448 $query .= " AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING'"; 449 $query .= " AND comment LIKE '%visit 1%'"; 450 $query .= " GROUP BY chunk"; 451 $query .= " ) AS groupchunk"; 452 $query .= " LEFT JOIN"; 453 $query .= " ("; 454 $query .= " SELECT groupobj.chunk,count(*) AS Nquad_fourvisits FROM "; 455 $query .= " (SELECT substr(comment, 1, position(' ' in comment)) AS chunk,count(distinct(comment)) AS Nvisits"; 456 $query .= " FROM rawExp"; 457 $query .= " WHERE dateobs LIKE '$date%' AND exp_id > $refExpID[0] AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%')"; 458 $query .= " AND obs_mode NOT LIKE 'ENGINEERING' AND comment LIKE '%visit%'"; 459 $query .= " GROUP BY object, filter, chunk"; 460 $query .= " ) AS groupobj"; 461 $query .= " WHERE groupobj.Nvisits = 4 "; 462 $query .= " GROUP BY groupobj.chunk"; 463 $query .= " ) AS group4"; 464 $query .= " on groupchunk.chunk=group4.chunk ORDER BY dateobs"; 465 466 #$sql = "SELECT DISTINCT substr(comment, 1, position(' ' in comment)) FROM rawExp WHERE dateobs LIKE '$date%' AND exp_id > $refExpID AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%') AND obs_mode NOT LIKE 'ENGINEERING' AND comment LIKE '%visit 1%'"; 467 468 $qry = $projectdb->query($query); 469 if (dberror($qry)) { 470 echo "<b>error reading rawExp table</b><br>\n"; 471 echo "<br><small><b> table query : $query </b></small><br>\n"; 472 menu_end(); 473 } 474 475 // set up the table 476 global $table; 477 echo $table; 478 echo "<tr>"; 479 createTableTitle("Status of last night's chunks", 5); 480 echo "<tr>"; 481 createTableColumnHeader("Chunk"); 482 createTableColumnHeader("Nobs_1stvisit"); 483 createTableColumnHeader("Nobs_4visits"); 484 createTableColumnHeader("Ndiffs_published"); 485 createTableColumnHeader("Completion"); 486 487 $msg = "No science images taken since $date"; 488 489 // list the results 490 while ($qry->fetchInto($row)) { 491 $Nfirstvisits = 0; 492 $Nfourvisits = 0; 493 494 $chunkname = $row[0]; 495 if($row[1] > 0) $Nfirstvisits = $row[1]; 496 if($row[2] > 0) $Nfourvisits = $row[2]; 497 498 $query2 = " SELECT warp_id FROM "; 499 $query2 .= " warpRun JOIN fakeRun USING (fake_id) JOIN camRun USING (cam_id) JOIN camProcessedExp USING (cam_id) JOIN chipRun USING (chip_id) JOIN rawExp USING (exp_id)"; 500 $query2 .= " WHERE rawExp.dateobs LIKE '$date%' AND exp_id > $refExpID[0] AND (obs_mode LIKE '%SS%' OR obs_mode LIKE '%BRIGHT%')"; 501 $query2 .= " AND substr(comment, 1, position(' ' in comment)) LIKE '$chunkname%'"; 502 $qry2 = $projectdb->query($query2); 503 504 $Ndiffs = 0; 505 while ($qry2->fetchInto($row2)) { 506 $query3 = " SELECT diff_id FROM "; 507 $query3 .= " diffRun JOIN diffInputSkyfile USING (diff_id) JOIN publishRun ON (diff_id = stage_id) JOIN warpRun ON (warp1=warp_id)"; 508 $query3 .= " WHERE stack2 IS NULL AND publishRun.state LIKE 'full' AND warp_id='$row2[0]' GROUP BY diff_id"; 509 $qry3 = $projectdb->query($query3); 510 while ($qry3->fetchInto($row3)) { 511 if ($row3[0] !=0) $Ndiffs ++; 512 } 513 514 $query3 = " SELECT diff_id FROM "; 515 $query3 .= " diffRun JOIN diffInputSkyfile USING (diff_id) JOIN publishRun ON (diff_id = stage_id) JOIN warpRun ON (warp2=warp_id)"; 516 $query3 .= " WHERE stack2 IS NULL AND publishRun.state LIKE 'full' AND warp_id='$row2[0]' GROUP BY diff_id"; 517 $qry3 = $projectdb->query($query3); 518 while ($qry3->fetchInto($row3)) { 519 if ($row3[0] !=0) $Ndiffs ++; 520 } 521 } 522 523 if ($Ndiffs != ($Nfirstvisits*4)) $complete = "chunk not done"; 524 if ($Ndiffs == ($Nfirstvisits*4)) $complete = "chunk done"; 525 526 if ($Nfirstvisits != $Nfourvisits) { 527 $Ndiffs .= "/? "; 528 } 529 if ($Nfirstvisits == $Nfourvisits) { 530 $Ndiffs .= "/"; 531 $Ndiffs .= $Nfirstvisits*4; 532 } 533 534 echo "<tr>"; 535 536 echo "<td>$chunkname</td>"; 537 echo "<td>$Nfirstvisits</td>"; 538 echo "<td>$Nfourvisits</td>"; 539 echo "<td>$Ndiffs</td>"; 540 echo "<td>$complete</td>"; 541 542 echo "</tr>"; 543 } 544 echo "</table>\n"; 545 546 } 547 548 ########################################################################### 549 # 403 550 # Gets labels for this server 404 551 # 405 552 ########################################################################### 406 function getLabels($db, $ server) {553 function getLabels($db, $proj, $server) { 407 554 408 555 # order by descending priority as set in project database 409 $sql = "SELECT label FROM current_labels WHERE server LIKE '$server' ORDER BY priority DESC, label";556 $sql = "SELECT label FROM science_labels WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY priority DESC, label"; 410 557 if ($debug) {echo "$sql<br>";} 411 558 … … 547 694 foreach ($stages as &$stage) { 548 695 549 $reverting = getRevertStatus($db, $ stage);696 $reverting = getRevertStatus($db, $proj, $stage); 550 697 if(!$reverting) {$label = "";} 551 698 if($reverting) {$label = "reverting";} … … 608 755 # 609 756 ########################################################################### 610 function setRevertStatus($db, $ stage, $reverting) {611 612 $sql = "UPDATE reverts SET reverting = $reverting WHERE stage LIKE '$stage'";757 function setRevertStatus($db, $proj, $stage, $reverting) { 758 759 $sql = "UPDATE science_reverts SET reverting = $reverting WHERE stage LIKE '$stage' AND telescope LIKE '$proj'"; 613 760 if ($debug) {echo "$sql<br>";} 614 761 … … 622 769 # 623 770 ########################################################################### 624 function getNightlyScienceStatus($db ) {625 626 $sql = "SELECT status FROM nightlyscience";771 function getNightlyScienceStatus($db, $proj) { 772 773 $sql = "SELECT status FROM science_nightlyscience WHERE telescope LIKE '$proj'"; 627 774 if ($debug) {echo "$sql<br>";} 628 775 … … 639 786 # 640 787 ########################################################################### 641 function turnRevertsOnOff($db, $ stage, $mode) {788 function turnRevertsOnOff($db, $proj, $stage, $mode) { 642 789 643 790 exec("czartool_revert.pl -t $stage -o $mode", $response, $status); … … 646 793 else if ($response[0] == "on") $currentRevertMode = 1; 647 794 648 setRevertStatus($db, $ stage, $currentRevertMode);795 setRevertStatus($db, $proj, $stage, $currentRevertMode); 649 796 } 650 797 … … 654 801 # 655 802 ########################################################################### 656 function getRevertStatus($db, $ stage) {803 function getRevertStatus($db, $proj, $stage) { 657 804 658 805 $anyFaults = false; 659 806 660 $sql = "SELECT reverting FROM reverts WHERE stage LIKE '$stage'";807 $sql = "SELECT reverting FROM science_reverts WHERE stage LIKE '$stage' AND telescope LIKE '$proj'"; 661 808 if ($debug) {echo "$sql<br>";} 662 809 … … 706 853 # 707 854 ########################################################################### 708 function createDatesTable($db ) {855 function createDatesTable($db, $proj) { 709 856 710 857 global $table; … … 717 864 echo "</tr>\n"; 718 865 719 createServerDateRow($db, "stdscience");720 createServerDateRow($db, "registration");866 createServerDateRow($db, $proj, "stdscience"); 867 createServerDateRow($db, $proj, "registration"); 721 868 722 869 echo "</table>\n"; … … 729 876 # 730 877 ########################################################################### 731 function createServerDateRow($db, $ server) {732 733 $sql = "SELECT date FROM s erver_dates WHERE server LIKE '$server' ORDER BY date";878 function createServerDateRow($db, $proj, $server) { 879 880 $sql = "SELECT date FROM science_server_dates WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY date"; 734 881 if ($debug) {echo "$sql<br>";} 735 882 … … 982 1129 } 983 1130 1131 ########################################################################### 1132 # 1133 # Shows the status of the various replication mysql servers 1134 # 1135 ########################################################################### 1136 function showDatabaseStatus($Host, $User, $Password, $DatabaseName) { 1137 #print "<br>$replHost, $replUser, $replPassword, $replDatabaseName<br/>"; 1138 $db = DB::connect("mysql://$User:$Password@$Host"); 1139 if (PEAR::isError($db)) { 1140 echo "<tr><td>$DatabaseName</td><td bgcolor=\"red\">MySQL DB connection error</td></tr>"; 1141 //die("MySQL DB connection error: Check the configuration for $DatabaseName"); 1142 //die(""); 1143 return -1; 1144 1145 } 1146 $Status = ($errorStatusInMySql==0?"OK":"<font style=\"BACKGROUND-COLOR: yellow\" color=\"red\">PROBLEM</font>"); 1147 echo "<tr><td>$DatabaseName</td><td>$Status</td></tr>"; 1148 1149 $db->disconnect(); 1150 } 1151 1152 ########################################################################### 1153 # 1154 # Shows the status of a machine using ping 1155 # 1156 ########################################################################### 1157 function showPingStatus($Host, $DatabaseName) { 1158 exec("ping -c 1 $Host", $res, $rval); 1159 if ($rval == 0){ 1160 $PingStatus= "UP"; 1161 }else{ 1162 $PingStatus = "<font style=\"BACKGROUND-COLOR: yellow\" color=\"red\">DOWN</font>"; 1163 } 1164 echo "<tr><td>$DatabaseName</td><td>$PingStatus</td></tr>"; 1165 } 1166 984 1167 ?> 985 1168 -
trunk/ippMonitor/raw/ipp.czar.dat
r40358 r40840 3 3 menutop | menutop | plain | | 4 4 5 menulink | menuselect | link | czartool - old | czartool_labels_old.php6 5 menulink | menuselect | link | czartool | czartool_labels.php 7 6 menulink | menuselect | link | mask stats | maskStats.php … … 10 9 menulink | menuselect | link | Exposures Status | exposureStatus.php 11 10 menulink | menuselect | link | MOPS Exposures Status | mopsStatus.php 12 menulink | menuselect | link | GPC1MySql ProcessList | gpc1MysqlProcessList.php11 menulink | menuselect | link | MySql ProcessList | gpc1MysqlProcessList.php 13 12 -
trunk/ippMonitor/raw/ipp.menu.dat
r38221 r40840 23 23 menutop | menutop | link | Stack Steps | ipp.stack.php 24 24 menutop | menutop | link | Static Sky Steps | ipp.sky.php 25 menutop | menutop | link | Full Force Steps | ipp.ffs.php 25 26 menutop | menutop | link | Distribution | ipp.dist.php 26 27 menutop | menutop | link | Large Area Processing | ipp.lap.php -
trunk/ippMonitor/raw/ipp.sky.dat
r38221 r40840 16 16 menulink | menuselect | link | Skycal Failed | skycal_failure.php 17 17 18 menutop | menutop | plain | |19 menulink | menuselect | link | Static Sky Summary | staticskySummary.php20 menulink | menuselect | link | Static Sky Run | staticskyRun.php21 menulink | menuselect | link | Static Sky Input Skyfile | staticskyInputSkyfile.php22 menulink | menuselect | link | Static Sky Processed Skyfile | staticskyProcessedSkyfile.php23 menulink | menuselect | link | Static Sky Failed Skyfile | staticskyFailedSkyfile.php24 menulink | menuselect | link | Static Sky Failed | failedStaticsky.php
Note:
See TracChangeset
for help on using the changeset viewer.
