Changeset 40840 for trunk/ippMonitor/czartool
- Timestamp:
- Jul 23, 2019, 2:24:01 PM (7 years ago)
- Location:
- trunk/ippMonitor/czartool
- Files:
-
- 5 edited
-
czarconfig.xml.in (modified) (1 diff)
-
czarpoll.pl (modified) (17 diffs)
-
czartool.pl (modified) (11 diffs)
-
czartool/CzarDb.pm (modified) (9 diffs)
-
czartool/Pantasks.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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";}
Note:
See TracChangeset
for help on using the changeset viewer.
