IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42902


Ignore:
Timestamp:
Jun 24, 2025, 4:30:05 PM (13 months ago)
Author:
cclin33
Message:

add restriction for stackInputSkyfile

Location:
trunk/ippMonitor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/def/stackInputSkyfile.d

    r40882 r42902  
    1 TABLE stackInputSkyfile JOIN stackRun USING (stack_id) JOIN warpRun USING (warp_id) JOIN warpSkyfile USING (warp_id) 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)
     1TABLE stackInputSkyfile JOIN stackRun USING (stack_id) JOIN warpRun USING (warp_id) JOIN warpSkyfile USING (warp_id, skycell_id) 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)
    22TITLE Stack Input Exposures
    33FILE  stackInputSkyfile.php
  • trunk/ippMonitor/raw/czartool_labels.php

    r42858 r42902  
    14121412    } else {
    14131413        if ($qry->fetchInto($row)) {
    1414             list($host, $total, $available, $used, $writable, $readable, $ratio) = $row;
    1415             $storageInfo = "<td>$ratio% of $total</td>";
     1414            list($host, $total, $available, $used, $writable, $readable, $ratioStr) = $row;
     1415            $ratio = floatval($ratioStr);  // convert to number
     1416   
     1417            // Determine color
     1418            if ($ratio < 80) {
     1419                $color = 'lightgreen';
     1420            } elseif ($ratio <= 90) {
     1421                $color = 'yellow';
     1422            } else {
     1423                $color = 'pink';
     1424            }
     1425   
     1426            $storageInfo = "<td style=\"background-color: $color;\">$ratioStr% of $total</td>";
    14161427        } else {
    14171428            $storageInfo = "<td>No host storage data</td>";
     
    14211432    $dbRepl = DB::connect("mysql://$replUser:$replPassword@$replHost");
    14221433    if (PEAR::isError($dbRepl)) {
    1423         echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: red; color: white;\">MySQL DB connection error - check configuration</td></tr>";
     1434        echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: pink;\">MySQL DB connection error - check configuration</td></tr>";
    14241435        return -1; // Don't stop the rest of the script
    14251436    }
     
    14281439    $res = $dbRepl->query('SHOW SLAVE STATUS');
    14291440    if (PEAR::isError($res)) {
    1430         echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: red; color: white;\">MySQL query error - invalid user or privileges</td></tr>";
     1441        echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: pink;\">MySQL query error - invalid user or privileges</td></tr>";
    14311442        $dbRepl->disconnect();
    14321443        return -1;
     
    14341445
    14351446    if (!$res->fetchInto($row)) {
    1436         echo "<tr><td>$replDatabaseName</td>$storageInfo<td>No replication data available</td></tr>";
     1447        echo "<tr><td>$replDatabaseName</td>$storageInfo<td style=\"background-color: pink;\">No replication data available</td></tr>";
    14371448        $dbRepl->disconnect();
    14381449        return 0;
     
    14491460    $replStatus = ($errorStatusInMySql == 0)
    14501461        ? "OK ($sec_behind sec behind)"
    1451         : "<span style=\"background-color: yellow; color: red;\">PROBLEM</span>";
     1462        : "<span style=\"color: red;\"><strong>PROBLEM</strong></span>";
    14521463
    14531464    echo "<tr><td>$replDatabaseName</td>$storageInfo";
    14541465
     1466    echo "<td>$replStatus</td></tr>";
     1467
    14551468    if ($errorStatusInMySql != 0) {
    1456         echo "<tr><td colspan=\"5\">Connect to <strong>$replDatabaseName</strong>, run <code>SHOW SLAVE STATUS</code>, and resolve the issue. ";
    1457         echo "See <a href=\"https://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html\" target=\"_blank\">MySQL Docs</a>.</td></tr>";
    1458     }
    1459 
    1460     echo "<td>$replStatus</td>";
     1469        echo "<tr><td colspan=\"5\" style=\"background-color: pink;\"><center>Connect to $hostPrefix replication database, run 'SHOW SLAVE STATUS', and fix the problem. ";
     1470        echo "See <a href=\"https://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html\" target=\"_blank\"><font color=\"blue\">MySQL Docs</a></font></center></td></tr>";
     1471    }
    14611472
    14621473    $dbRepl->disconnect();
     
    14901501    } else {
    14911502        if ($qry->fetchInto($row)) {
    1492             list($host, $total, $available, $used, $writable, $readable, $ratio) = $row;
    1493             $storageInfo = "<td>$ratio% of $total </td>";
     1503            list($host, $total, $available, $used, $writable, $readable, $ratioStr) = $row;
     1504            $ratio = floatval($ratioStr);  // convert to number
     1505   
     1506            // Determine color
     1507            if ($ratio < 80) {
     1508                $color = 'lightgreen';
     1509            } elseif ($ratio <= 90) {
     1510                $color = 'yellow';
     1511            } else {
     1512                $color = 'pink';
     1513            }
     1514   
     1515            $storageInfo = "<td style=\"background-color: $color;\">$ratioStr% of $total</td>";
    14941516        } else {
    14951517            $storageInfo = "<td>No host storage data</td>";
     
    15961618    if ($debug) {echo "$sql<br>";}
    15971619
     1620
    15981621    $qry = $projectdb->query($sql);
    15991622    while ($qry->fetchInto($tmp)) {
    16001623        list($expType, $downloadState, $rawState, $count, $summit_exp, $pz_exp, $raw_exp) = $tmp;
     1624        if ($proj == "gpc1") {
     1625            $summit_exp_link = "<a href=\"https://svn.ifa.hawaii.edu/summit/ds/gpc1/$summit_exp/\" target='_blank'><font color=\"blue\">$summit_exp</font></a>";
     1626        } else {
     1627            $summit_exp_link = "<a href=\"https://svn.ifa.hawaii.edu/conductorb/ds/gpc2/$summit_exp/\" target='_blank'><font color=\"blue\">$summit_exp</font></a>";
     1628        }
    16011629        if ($downloadState == NULL) {
    1602           echo  "<tr><td> $expType ($summit_exp) <td> loading imfiles <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count";
     1630          echo  "<tr><td> $summit_exp_link $expType <td> loading imfiles <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count";
    16031631        } else {
    16041632          if ($downloadState == 'run') {
    1605             echo  "<tr><td> $expType ($summit_exp) <td> summit_copy ($pz_exp) <td> saving ($pz_exp) <td bgcolor=$columnHeaderColor> <font color=\"red\">$count";
     1633            echo  "<tr><td> $summit_exp_link $expType <td> $pz_exp copying <td> $pz_exp saving <td bgcolor=$columnHeaderColor> <font color=\"red\">$count";
    16061634          } else {
    16071635            if ($rawState == NULL) {
    1608               echo  "<tr><td> $expType ($summit_exp) <td> $downloadState ($pz_exp) <td> registering ($pz_exp) <td bgcolor=$columnHeaderColor> <font color=\"blue\">$count";
    1609             } else {
    1610               echo  "<tr><td> $expType ($summit_exp) <td> $downloadState ($pz_exp) <td> $rawState ($raw_exp) <td> $count";
     1636              echo  "<tr><td> $summit_exp_link $expType <td> $pz_exp $downloadState <td> $pz_exp registering <td bgcolor=$columnHeaderColor> <font color=\"blue\">$count";
     1637            } else {                                   
     1638              echo  "<tr><td> $summit_exp_link $expType <td> $pz_exp $downloadState <td> $raw_exp $rawState <td> $count";
    16111639            }
    16121640          }
     
    16291657            AND summitExp.exp_name LIKE '$expnamem1' ORDER BY summitExp.dateobs desc) as sub
    16301658        GROUP BY sum_type, pzstate, rawstate";
    1631     // $sql = "
    1632     //     SELECT summitExp.exp_type, pzDownloadExp.state, rawExp.state, COUNT(*)
    1633     //     FROM summitExp
    1634     //     LEFT JOIN pzDownloadExp USING (summit_id)
    1635     //     LEFT JOIN rawExp ON summitExp.exp_name = rawExp.exp_name
    1636     //     WHERE summitExp.summit_id >= (
    1637     //         SELECT COALESCE(MIN(summit_id), 0)
    1638     //         FROM summitExp
    1639     //         WHERE exp_name LIKE '$expnamem5'
    1640     //     )
    1641     //     AND summitExp.exp_name LIKE '$expnamem1'
    1642     //     GROUP BY summitExp.exp_type, pzDownloadExp.state, rawExp.state";
    16431659    if ($debug) {echo "$sql<br>";}
    16441660
     
    16461662    while ($qry->fetchInto($tmp)) {
    16471663        list($expType, $downloadState, $rawState, $count, $summit_exp, $pz_exp, $raw_exp) = $tmp;
     1664        if ($proj == "gpc1") {
     1665            $summit_exp_link = "<a href=\"https://svn.ifa.hawaii.edu/summit/ds/gpc1/$summit_exp/\" target='_blank'><font color=\"blue\">$summit_exp</font></a>";
     1666        } else {
     1667            $summit_exp_link = "<a href=\"https://svn.ifa.hawaii.edu/conductorb/ds/gpc2/$summit_exp/\" target='_blank'><font color=\"blue\">$summit_exp</font></a>";
     1668        }
    16481669        if ($downloadState == NULL) {
    1649           echo  "<tr><td> $expType ($summit_exp) <td> loading imfiles <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count";
     1670          echo  "<tr><td> $summit_exp_link $expType <td> loading imfiles <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count";
    16501671        } else {
    16511672          if ($downloadState == 'run') {
    1652             echo  "<tr><td> $expType ($summit_exp) <td> summit_copy ($pz_exp) <td> saving ($pz_exp) <td bgcolor=$columnHeaderColor> <font color=\"red\">$count";
     1673            echo  "<tr><td> $summit_exp_link $expType <td> $pz_exp copying <td> $pz_exp saving <td bgcolor=$columnHeaderColor> <font color=\"red\">$count";
    16531674          } else {
    16541675            if ($rawState == NULL) {
    1655               echo  "<tr><td> $expType ($summit_exp) <td> $downloadState ($pz_exp) <td> registering <td bgcolor=$columnHeaderColor> <font color=\"blue\">$count";
    1656             } else {
    1657               echo  "<tr><td> $expType ($summit_exp) <td> $downloadState ($pz_exp) <td> $rawState ($raw_exp) <td> $count";
     1676              echo  "<tr><td> $summit_exp_link $expType <td> $pz_exp $downloadState <td> $pz_exp registering <td bgcolor=$columnHeaderColor> <font color=\"blue\">$count";
     1677            } else {                                   
     1678              echo  "<tr><td> $summit_exp_link $expType <td> $pz_exp $downloadState <td> $raw_exp $rawState <td> $count";
    16581679            }
    16591680          }
    16601681        }
    16611682    }
    1662     //while ($qry->fetchInto($tmp)) {
    1663     //    list($expType, $downloadState, $rawState, $count) = $tmp;
    1664     //    if ($downloadState == NULL) {
    1665     //      echo  "<tr><td> $expType <td> null <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$count";
    1666     //    } else {
    1667     //      if ($downloadState == 'run') {
    1668     //        echo  "<tr><td> $expType <td> loading <td> null <td bgcolor=$columnHeaderColor> <font color=\"red\">$count";
    1669     //      } else {
    1670     //        if ($rawState == NULL) {
    1671     //          echo  "<tr><td> $expType <td> $downloadState <td> loading <td bgcolor=$columnHeaderColor> <font color=\"blue\">$count";
    1672     //        } else {
    1673     //          echo  "<tr><td> $expType <td> $downloadState <td> download ($rawState) <td> $count";
    1674     //        }
    1675     //      }
    1676     //    }
    1677     //}
    16781683
    16791684    echo "<tr><th colspan=4>";
Note: See TracChangeset for help on using the changeset viewer.