IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39804


Ignore:
Timestamp:
Nov 4, 2016, 5:51:29 PM (10 years ago)
Author:
mhuber
Message:

(MEH) fixing error report for db repl if null sec_behind and misc old changes of others

File:
1 edited

Legend:

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

    r39498 r39804  
    8080
    8181$servers=array(
    82         "addstar",
    83         "addstarlap",
     82        #"addstar",
     83        #"addstarlap",
     84        "ippqub:stdscience_ws",
    8485        "cleanup",
    85         "detrend",
     86        #"detrend",
    8687        "distribution",
    8788        "pstamp",
     
    270271      createTableColumnHeader("Status (sec behind master)");
    271272      showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
    272 
     273      showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_DBNAME_NEBULOUS_SECONDARY);
    273274      # XXX EAM : problem showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
    274275      showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP);
    275276      showReplicationsStatus($REPL_HOST_IPPADMIN, $REPL_USER_IPPADMIN, $REPL_PASSWORD_IPPADMIN, $REPL_DBNAME_IPPADMIN);
    276277      showReplicationsStatus($REPL_HOST_ISP, $REPL_USER_ISP, $REPL_PASSWORD_ISP, $REPL_DBNAME_ISP);
    277       showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_DBNAME_NEBULOUS_SECONDARY);
     278##      showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_DBNAME_NEBULOUS_SECONDARY);
    278279      echo "</table>";
    279280
     
    313314
    314315    // list the results
    315     while (dbFetchInto($qry, $row)) {
     316    while ($qry->fetchInto($row)) {
    316317
    317318        echo "<tr>";
     
    358359
    359360    // list the results
    360     while (dbFetchInto($qry, $expType)) {
     361    while ($qry->fetchInto($expType)) {
    361362
    362363        $sql = "SELECT COUNT(*) FROM summitExp WHERE dateobs > '$date' AND exp_type = '$expType[0]'";
    363364        $qry2 = $projectdb->query($sql);
    364       dbFetchInto($qry2, $summit);
     365        $qry2->fetchInto($summit);
    365366        $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name WHERE summitExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'";
    366367        $qry2 = $projectdb->query($sql);
    367       dbFetchInto($qry2, $mhpcc);
     368        $qry2->fetchInto($mhpcc);
    368369
    369370        echo "<tr>";
     
    397398    $qry = $db->query($sql);
    398399    if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";}
    399     while (dbFetchInto($qry, $row)) {
     400    while ($qry->fetchInto($row)) {
    400401
    401402        $labels[] = $row[0];
     
    621622    $qry = $db->query($sql);
    622623    if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";}
    623     dbFetchInto($qry, $row);
     624    $qry->fetchInto($row);
    624625
    625626    return $row[0];
     
    655656    $qry = $db->query($sql);
    656657    if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";}
    657     dbFetchInto($qry, $row);
     658    $qry->fetchInto($row);
    658659
    659660    return $row[0];
     
    673674    $qry = $db->query($sql);
    674675    if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";}
    675     dbFetchInto($qry, $row);
     676    $qry->fetchInto($row);
    676677
    677678    $pending = $row[0];
     
    730731    $dates = "";
    731732    $firstIn = true;
    732     while (dbFetchInto($qry, $row)) {
     733    while ($qry->fetchInto($row)) {
    733734
    734735        if ($firstIn) {
     
    887888    $qry = $db->query($sql);
    888889    if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";}
    889     dbFetchInto($qry, $row);
     890    $qry->fetchInto($row);
    890891
    891892    $alive = $row[0];
     
    906907    $qry = $db->query($sql);
    907908    if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";}
    908     dbFetchInto($qry, $row);
     909    $qry->fetchInto($row);
    909910
    910911    return $row[0];
     
    947948    }
    948949    $res = $dbRepl->query('SHOW SLAVE STATUS');
    949     while (dbFetchInto($res, $row)) {
     950    while ($res->fetchInto($row)) {
    950951        # Have a look for Last_Errno in http://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html
    951952        $errorStatusInMySql = $row[18];
    952953        $sec_behind = $row[32];
    953         $replStatus = ($errorStatusInMySql==0?"OK ($sec_behind)":"<font color=\"red\">PROBLEM</font>");
     954        if ($sec_behind===NULL) {
     955            $sec_behind = 99999999;
     956            $errorStatusInMySql = 999999999;
     957        }   
     958        $replStatus = ($errorStatusInMySql==0?"OK ($sec_behind)":"<font style=\"BACKGROUND-COLOR: yellow\"  color=\"red\">PROBLEM</font>");
    954959        echo "<tr><td>$replDatabaseName</td><td>$replStatus</td></tr>";
    955960        if ($errorStatusInMySql!=0) {
Note: See TracChangeset for help on using the changeset viewer.