IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 27, 2011, 3:23:16 PM (15 years ago)
Author:
rhenders
Message:

Added table showing current dates for stdscience and registration; re-added ability to see server status

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/czartool_labels.php

    r30381 r30392  
    6666echo "<p  align=\"center\"> Current status of the IPP as of $lastUpdateTime (faults are shown in parentheses). <br>Documentation can be found <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\">here</a> and cluster load monitored <a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&c=IPP%2520Production\">here</a><br>Current nightly science status: $nsStatus<br>Use <a href=\"$link\"> $plotTypeLink</a> plots <br/><a href=\"http://ipp004.ifa.hawaii.edu/clusterMonitor/top.html\">Who uses the cluster?</a><br><a href=\"http://ipp004.ifa.hawaii.edu/ippMetrics\">IPP Metrics</a><br/><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PS1_IPP_CzarLogs\">Czar log pages</a><br><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\">Exposure summary</a></p>";
    6767
    68 
    6968// deal with reverts: turn on or off if requested and pass current revert state for this stage onto labels table later
    7069if ($selectedRevertStage && $selectedRevertMode) turnRevertsOnOff($czardb, $selectedRevertStage, $selectedRevertMode);
     
    182181            echo "<td> \n";
    183182              $today = date("Y-m-d");
    184               showSummitData($gpc1db, $today);
     183              createSummitDataTable($gpc1db, $today);
    185184            echo "</td>\n";
    186185          echo "</tr>\n";
     
    189188    echo "</tr>\n";
    190189
    191 
    192190    # 4th row
     191    echo "<tr>\n";
     192      echo "<td> \n";
     193        echo "<table>\n";
     194          echo "<tr valign=top>\n";
     195            echo "<td> \n";
     196              if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
     197            echo "</td>\n";
     198            echo "<td>\n";
     199              createDatesTable($czardb);
     200            echo "</td>\n";
     201          echo "</tr>\n";
     202        echo "</table>\n";
     203      echo "</td> \n";
     204    echo "</tr>\n";
     205
     206    # 5th row
    193207    echo "<tr>\n";
    194208      echo "<td>\n";
     
    206220                showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
    207221                showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
     222
    208223              echo "</table>";
    209224            echo "</td>\n";
     
    213228    echo "</tr>\n";
    214229
    215     # 5th row
    216     echo "<tr>\n";
    217       echo "<td> \n";
    218         echo "<table>\n";
    219           echo "<tr valign=top>\n";
    220             echo "<td> \n";
    221               # server output
    222               if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
    223             echo "</td>\n";
    224             echo "<td>\n";
    225             echo "</td>\n";
    226           echo "</tr>\n";
    227         echo "</table>\n";
    228       echo "</td> \n";
    229     echo "</tr>\n";
    230 
    231230  echo "</table>\n";
    232231
     
    236235###########################################################################
    237236#
    238 # Checks summitExp table agains rawExp table
    239 #
    240 ###########################################################################
    241 function showSummitData($gpc1db, $date) {
     237# Creates a table of summitExp against rawExp
     238#
     239###########################################################################
     240function createSummitDataTable($gpc1db, $date) {
    242241
    243242    $sql = "SELECT DISTINCT exp_type FROM summitExp WHERE dateobs > '$date'";
     
    590589###########################################################################
    591590#
     591# Populates a tables with the current dates listed in the server_dates table
     592#
     593###########################################################################
     594function createDatesTable($db) {
     595
     596    $class = "list";
     597    echo "<table class=$class>\n";
     598    echo "<tr><td></td>\n";
     599    write_header_cell($class, "Server");
     600    write_header_cell($class, "Dates");
     601    echo "</tr>\n";
     602
     603    createServerDateRow($db, "stdscience");
     604    createServerDateRow($db, "registration");
     605
     606    echo "</table>\n";
     607}
     608
     609
     610###########################################################################
     611#
     612# Checks the status of all the pantasks servers
     613#
     614###########################################################################
     615function createServerDateRow($db, $server) {
     616
     617    $sql = "SELECT date FROM server_dates WHERE server LIKE '$server' ORDER BY date";
     618    if ($debug) {echo "$sql<br>";}
     619
     620    $qry = $db->query($sql);
     621    if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";}
     622    $dates = "";
     623    $firstIn = true;
     624    while ($qry->fetchInto($row)) {
     625
     626        if ($firstIn) {
     627
     628            $dates = $row[0];
     629            $firstIn = false;
     630        }
     631        else $dates = $dates . ", " . $row[0];
     632    }
     633
     634    $class = "list";
     635    echo "<tr><td></td>\n";
     636    write_table_cell($class, '%s', "", $server);
     637    write_table_cell($class, '%s', "", $dates);
     638    echo "</tr>\n";
     639
     640}
     641
     642###########################################################################
     643#
    592644# Checks the status of all the pantasks servers
    593645#
     
    633685            ."&plottype=".$plotType;
    634686
    635         $link = ""; # TODO removed links temporarily
    636             write_table_cell($class, '%s', $link, $server);
     687        #$link = ""; # TODO removed links temporarily
     688        write_table_cell($class, '%s', $link, $server);
    637689        write_table_cell($class, '%s', "", $alive ? "yes" : "NO");
    638690
Note: See TracChangeset for help on using the changeset viewer.