IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41135 for trunk


Ignore:
Timestamp:
Nov 25, 2019, 4:14:49 PM (7 years ago)
Author:
ippitc
Message:

CCL: update czarpoll path and installation instruction

Location:
trunk/ippMonitor
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/INSTALL

    r41126 r41135  
    1212# testing of those parts of ippMonitor which depend on IPP code without modifyin
    1313# the operational installation
    14 # 2019.11.18 CCL: which parts of ippMonitor depends on IPP codes?  If there is not many
     14# 2019.11.18 CCL: not sure which parts of ippMonitor depends on IPP codes?  If there is not many
    1515#                 , just use trunk version should work fine.
    1616psconfig ipp-trunk-20180515
    1717
    18 # run psconfigure to generate Makefile and raw/site.php (site.php.in includes CZARPLOTDIR now)
     18# run psconfigure to generate Makefile and raw/site.php
     19# $CZARPLOTDIR and $METRICSPLOTDIR will be generated a link in the same folder as ippMonitor 
    1920psconfigure --htdocs /var/www/localhost/htdocs --site ~/ippconfig/ippmonitor.config
    2021
    21 # copy these files and modify them
     22# copy these files and modify them (CCL removed CZARPLOTDIR)
    2223cp config.dat.in config.dat
    2324
    24 # for czarpool.pl, the path needs to be defined.
    25 cp czartool/czarconfig.xml.in czartool/czarconfig.xml
    26 # then set gnuplot path <path>/export/ipp113.0/ipp/czartool_plots</path>  --> for ipp113
    27 # ipp117 is set to be rsynced in crontab regularly from ipp113's path,
    28 # so need to remove crontab if czarpool.pl is under development
    29 # then set gnuplot path <path>/export/ipp117.0/ipp/czartool_plots</path>  --> for ipp117
    30 
    3125# install the php code:
     26# czartool_plots and ippMetrics will be linked to different path in different hostnames
    3227make
    3328
     29# for running czarpool.pl,
     30cp czartool/czarconfig.xml.in czartool/czarconfig.xml
     31# then set gnuplot path for czartool_plots and ippMetrics in ippMonitor dir
     32# <path>/var/www/localhost/htdocs/ippMonitor/czartool_plots</path>
     33# <savelocation>/var/www/localhost/htdocs/ippMonitor/ippMetrics</savelocation>
     34# enter czartool
     35./czarpool.pl
    3436
  • trunk/ippMonitor/Makefile.in

    r41126 r41135  
    1 default: updateVersion php
     1default: updateVersion php mklink
    22help:
    33        @echo "USAGE: make php"
     
    99DESTBIN = @BINDIR@
    1010DESTWWW = @HTDOCS@/ippMonitor
     11CZARPLOTDIR = /export/@HOST2@.0/ipp/czartool_plots
     12METRICSPLOTDIR = /export/@HOST2@.0/ipp/ippMetrics
    1113
    1214GENERATE = $(SCRIPTS)/generate
     
    173175$(DESTWWW)/fullforceSummary.php \
    174176$(DESTWWW)/fullforce_failure.php \
     177$(DESTWWW)/failedFullforce.php \
    175178$(DESTWWW)/diffSummary.php \
    176179$(DESTWWW)/diffSummary_Images.php \
     
    281284
    282285DESTLINK = $(DESTWWW)/index.php
    283 
    284 php: $(RAWSRC) $(DEFSRC) $(PICTURES) $(DESTLINK) $(PROGRAMS)
     286CZPLOTSLINK = $(DESTWWW)/czartool_plots
     287METRICSLINK = $(DESTWWW)/ippMetrics
     288
     289
     290php: $(RAWSRC) $(DEFSRC) $(PICTURES) $(DESTLINK) $(PROGRAMS)
    285291
    286292# dependancy rules for binary code #########################
     
    311317updateVersion:
    312318        rm -f $(DESTWWW)/version.php
    313 
    314 test:
     319        @if [ ! -d $(CZARPLOTDIR) ]; then mkdir -p $(CZARPLOTDIR); fi
     320        @if [ ! -d $(METRICSPLOTDIR) ]; then mkdir -p $(METRICSPLOTDIR); fi
     321
     322mklink: $(CZPLOTSLINK) $(METRICSLINK)
     323
     324$(CZPLOTSLINK): $(CZARPLOTDIR)
     325        rm -f $@
     326        ln -s $(CZARPLOTDIR) $@
     327
     328$(METRICSLINK): $(METRICSPLOTDIR)
     329        rm -f $@
     330        ln -s $(METRICSPLOTDIR) $@
     331
     332test:
    315333#DESTWWW := $(DESTWWW)/test
    316334        echo $(DESTWWW)
     
    355373        cp $(SCRIPTS)/$* $(DESTBIN)/$* || exit
    356374        chmod +x $(DESTBIN)/$* || exit
     375
     376
     377
    357378
    358379# utilities #################################################
  • trunk/ippMonitor/raw/czartool_labels.php

    r41134 r41135  
    214214echo "<td style=height:200px;width:400px;text-align:top;\">";
    215215
    216 #echo "<br>";
     216/////////////////////////////////////////
     217// timer begin for status and links
     218/////////////////////////////////////////
     219$time = microtime();
     220$time = explode(' ', $time);
     221$time = $time[1] + $time[0];
     222$start = $time;
    217223
    218224// status table at top
    219225$nsStatus = getNightlyScienceStatus($czardb, $proj);
    220226$plotTypeLink = ($plotType == "linear") ? "log" : "linear";
    221 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink";
     227$link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel .
     228        "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink";
     229
    222230echo "<br>";
    223231echo $table;
    224 
    225 createTableTitle("Status and links", 3);
     232createTableTitle("Status and links", 2);
    226233echo "<tr>\n";
    227 echo "<tr><td>Time of last update</td><td>$lastUpdateTime</td></tr>";
    228 echo "<tr><td>ippMonitor SVN version</td><td>"; include 'version.php'; echo "</td></tr>";
    229 echo "<tr><td>Current nightly science status</td><td>$nsStatus</td></tr>";
    230 echo "<tr><td>Postage stamp server status</td><td><a href=\"http://pstamp.ipp.ifa.hawaii.edu/status.php\"><font color=\"blue\">here</font></a></td></tr>";
    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>";
    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>";
    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>";
    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>";
     234echo "<tr><td>Time of last update</td>
     235          <td>$lastUpdateTime</td></tr>";
     236echo "<tr><td>ippMonitor SVN version</td>
     237          <td>"; include 'version.php'; echo "</td></tr>";
     238echo "<tr><td>Current nightly science status</td>
     239          <td>$nsStatus</td></tr>";
     240echo "<tr><td>Postage stamp server status</td>
     241          <td><a href=\"http://pstamp.ipp.ifa.hawaii.edu/status.php\" target=new><font color=\"blue\">here</font></a></td></tr>";
     242echo "<tr><td>Documentation</td>
     243          <td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\" target=new><font color=\"blue\">here</font></a></td></tr>";
     244echo "<tr><td>Cluster load</td>
     245          <td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&hc=6&c=IPP%2520Production\">
     246              <font color=\"blue\">here</font></a>
     247              <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\">
     248              <font color=\"blue\">cpu_report</font></a>
     249              <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\">
     250              <font color=\"blue\">mem_report</font></a></td></tr>";
     251echo "<tr><td>IPP metrics</td>
     252          <td><a href=\"https://ps1wiki.ifa.hawaii.edu/data/metrics/index.html\"><font color=\"blue\" target=new>here</font></a></td></tr>";
     253echo "<tr><td>Czar log pages</td>
     254          <td><a href=\"https://confluence.ipp.ifa.hawaii.edu/pages/viewrecentblogposts.action?key=IPPCZAR\" target=new><font color=\"blue\">here</font></a></td></tr>";
     255echo "<tr><td>Exposure summary</td>
     256          <td><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\"><font color=\"blue\">here</font></a></td></tr>";
     257echo "<tr><td>Confluence</td>
     258          <td><a href=\"https://confluence.ipp.ifa.hawaii.edu/display/IPPCZAR/IPP-Czaring+Home\" target=new><font color=\"blue\">here</font></a></td></tr>";
     259echo "<tr><td>JIRA</td>
     260          <td><a href=\"https://jira.ipp.ifa.hawaii.edu/secure/Dashboard.jspa\" target=new><font color=\"blue\">here</font></a></td></tr>";
     261echo "<tr><td>data store</td>
     262          <td><a href=\"https://svn.ifa.hawaii.edu/\" target=new><font color=\"blue\">here</font></a></td></tr>";
    238263
    239264$plotTypeLink = ($plotType == "linear") ? "log" : "linear";
    240 $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&mode=" . $selectedMode . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink";
    241 
    242 echo "</table>\n";
    243 
    244 echo "<br>";
    245 
    246        createLabelsTable($pass,
    247          $proj,
    248          $czardb,
    249          $selectedMode,
    250          $labels,
    251          $distLabelsExist,
    252          $pubLabelsExist,
    253          $stages,
    254          "new",
    255          $selectedLabel,
    256          $selectedStage,
    257          $plotType);
    258 
    259       if ($selectedMode == "update") {echo "<br>"; createPStampDataTable();}
    260       echo "<br>";
    261 
    262       # XXX EAM : 2017.09.17 : debugging slowness
    263       createServersTable($pass, $proj,$selectedMode,$czardb, $servers, $selectedLabel, $selectedStage, $plotType); echo "<br>";
    264       createSummitDataTable($projectdb); echo "<br>"; // this is slow because of the join between summitExp and rawExp
    265       createChunkDataTable($projectdb); echo "<br>";
    266       createDatesTable($czardb, $proj); echo "<br>";
    267 
    268       echo $table;
    269       echo "<tr>";
    270       createTableTitle("Database status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)", 2);
    271 
    272       echo "<tr>";
    273       createTableColumnHeader("Database");
    274       createTableColumnHeader("Status (sec behind master)");
    275       showDatabaseStatus($HOST_GPC1, $USER_GPC1, $PASSWORD_GPC1, $DBNAME_GPC1);
    276       showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
    277       showReplicationsStatus($REPL_HOST_GPC1_SECONDARY, $REPL_USER_GPC1_SECONDARY, $REPL_PASSWORD_GPC1_SECONDARY, $REPL_DBNAME_GPC1_SECONDARY);
    278 
    279       echo "<tr>";
    280 
    281       showDatabaseStatus($HOST_NEBULOUS, $USER_NEBULOUS, $PASSWORD_NEBULOUS, $DBNAME_NEBULOUS);
    282       showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
    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);
    285 
    286 #     some mysql replication slaves to add when they are returned to service
    287 #     showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP);
    288 #     showReplicationsStatus($REPL_HOST_ISP, $REPL_USER_ISP, $REPL_PASSWORD_ISP, $REPL_DBNAME_ISP);
    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_APACHE7, $DBNAME_APACHE7);
    308       showPingStatus($HOST_PROXY, $DBNAME_PROXY);
    309       showPingStatus($HOST_SVN, $DBNAME_SVN);
    310       showPingStatus($HOST_CONFLUENCE, $DBNAME_CONFLUENCE);
    311 
    312       echo "</table>";
    313 
    314 echo "</table>";
     265$link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&mode=" . $selectedMode .
     266        "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink";
     267
     268// timer finished
     269echo "<tr><th colspan=4>";
     270$time = microtime();
     271$time = explode(' ', $time);
     272$time = $time[1] + $time[0];
     273$finish = $time;
     274$total_time = round(($finish - $start), 3);
     275echo "loading in $total_time seconds.";
     276echo "</th></tr>";
     277echo "</table><br>";
     278
     279createLabelsTable($pass, $proj, $czardb, $selectedMode, $labels,
     280  $distLabelsExist, $pubLabelsExist, $stages, "new", $selectedLabel,
     281  $selectedStage, $plotType);
     282if ($selectedMode == "update") {echo "<br>"; createPStampDataTable();}
     283
     284# XXX EAM : 2017.09.17 : debugging slowness
     285# CCL : 2019.11.09 : debugging slowness
     286//createSummitDataTable($projectdb); // this is slow because of the join between summitExp and rawExp, but not the major one
     287createSummitDataTable2($projectdb); // this is slow because of the join between summitExp and rawExp, but not the major one
     288
     289createServersTable($pass, $proj,$selectedMode,$czardb, $servers, $selectedLabel, $selectedStage, $plotType);
     290// this was the major slowness part due to large table in czardb
     291
     292createChunkDataTable($projectdb);  // this is another part for slowness during nightly processing
     293
     294createDatesTable($czardb, $proj);
     295
     296/////////////////////////////////////////
     297// timer begin for Database status
     298/////////////////////////////////////////
     299$time = microtime();
     300$time = explode(' ', $time);
     301$time = $time[1] + $time[0];
     302$start = $time;
     303
     304// status table at top
     305  echo $table;
     306  echo "<tr>";
     307  createTableTitle("Database status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)", 2);
     308 
     309  echo "<tr>";
     310  createTableColumnHeader("Database");
     311  createTableColumnHeader("Status (sec behind master)");
     312  showDatabaseStatus($HOST_GPC1, $USER_GPC1, $PASSWORD_GPC1, $DBNAME_GPC1);
     313  showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
     314  showReplicationsStatus($REPL_HOST_GPC1_SECONDARY, $REPL_USER_GPC1_SECONDARY, $REPL_PASSWORD_GPC1_SECONDARY, $REPL_DBNAME_GPC1_SECONDARY);
     315 
     316  echo "<tr>";
     317  showDatabaseStatus($HOST_NEBULOUS, $USER_NEBULOUS, $PASSWORD_NEBULOUS, $DBNAME_NEBULOUS);
     318  showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
     319  showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_DBNAME_NEBULOUS_SECONDARY);
     320  showReplicationsStatus($REPL_HOST_DATASTORE_SECONDARY, $REPL_USER_DATASTORE_SECONDARY, $REPL_PASSWORD_DATASTORE_SECONDARY, $REPL_DBNAME_DATASTORE_SECONDARY);
     321 
     322//  some mysql replication slaves to add when they are returned to service
     323//  showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP);
     324//  showReplicationsStatus($REPL_HOST_ISP, $REPL_USER_ISP, $REPL_PASSWORD_ISP, $REPL_DBNAME_ISP);
     325
     326// timer finished
     327echo "<tr><th colspan=2>";
     328$time = microtime();
     329$time = explode(' ', $time);
     330$time = $time[1] + $time[0];
     331$finish = $time;
     332$total_time = round(($finish - $start), 3);
     333echo "loading in $total_time seconds.";
     334echo "</th></tr>";
     335echo "</table><br>";
     336
     337/////////////////////////////////////////
     338// timer begin for critical machines
     339/////////////////////////////////////////
     340$time = microtime();
     341$time = explode(' ', $time);
     342$time = $time[1] + $time[0];
     343$start = $time;
     344
     345// status table at top
     346  $PingStatus = "<font style=\"BACKGROUND-COLOR: yellow\"  color=\"red\">DOWN</font>";
     347  echo $table;
     348  echo "<tr>";
     349  createTableTitle("Critical machine status", 3);
     350
     351  echo "<tr>";
     352  createTableColumnHeader("Hostname");
     353  createTableColumnHeader("Status");
     354  createTableColumnHeader("Loading time");
     355  showPingStatus($HOST_GATEWAY, $DBNAME_GATEWAY);
     356  showPingStatus($HOST_GATEWAY_SECONDARY, $DBNAME_GATEWAY_SECONDARY);
     357  showPingStatus($HOST_APACHE1, $DBNAME_APACHE1);
     358  showPingStatus($HOST_APACHE2, $DBNAME_APACHE2);
     359  showPingStatus($HOST_APACHE3, $DBNAME_APACHE3);
     360  showPingStatus($HOST_APACHE4, $DBNAME_APACHE4);
     361  showPingStatus($HOST_APACHE5, $DBNAME_APACHE5);
     362  showPingStatus($HOST_APACHE6, $DBNAME_APACHE6);
     363  showPingStatus($HOST_APACHE7, $DBNAME_APACHE7);
     364  showPingStatus($HOST_APACHE8, $DBNAME_APACHE8);
     365//     echo "<td>ippc70 (apache node) <td> $PingStatus <td> 0 seconds ";  // comment out if ippc70 is back
     366  showPingStatus($HOST_PROXY, $DBNAME_PROXY);
     367  showPingStatus($HOST_SVN, $DBNAME_SVN);
     368  showPingStatus($HOST_CONFLUENCE, $DBNAME_CONFLUENCE);
     369
     370// timer finished
     371echo "<tr><th colspan=3>";
     372$time = microtime();
     373$time = explode(' ', $time);
     374$time = $time[1] + $time[0];
     375$finish = $time;
     376$total_time = round(($finish - $start), 3);
     377echo "loading in $total_time seconds.";
     378echo "</th></tr>";
     379echo "</table><br>";
     380   
     381
    315382menu_end();
    316383
     384
     385#############################################################################
     386#############################  Functions Below  #############################
     387#############################################################################
    317388
    318389###########################################################################
     
    361432}
    362433
    363 ###########################################################################
    364 #
    365 # Creates a table of summitExp against rawExp
    366 #
    367 ###########################################################################
    368 function createSummitDataTable($projectdb) {
    369 
    370     $date = date("Y-m-d");
    371     $sql = "SELECT DISTINCT exp_type FROM summitExp WHERE dateobs > '$date'";
    372 
    373     $qry = $projectdb->query($sql);
    374     if (dberror($qry)) {
    375         echo "<b>error reading newExp table</b><br>\n";
    376         echo "<br><small><b> table query : $sql </b></small><br>\n";
    377         menu_end();
    378     }
    379 
    380     // set up the table
    381     global $table;
    382     echo $table;
    383     echo "<tr>";
    384     createTableTitle("Status of last night's data", 4);
    385     echo "<tr>";
    386     createTableColumnHeader("Exposure type");
    387     createTableColumnHeader("At summit");
    388     createTableColumnHeader("Registered at MHPCC");
    389     createTableColumnHeader("At summit (Dropped)");
    390 
    391     $msg = "No science images taken since $date";
    392 
    393     // list the results
    394     while ($qry->fetchInto($expType)) {
    395 
    396         $sql = "SELECT COUNT(*) FROM summitExp left join pzDownloadExp using (summit_id) WHERE dateobs > '$date' AND exp_type = '$expType[0]' and (state != 'drop' or state is null) and fault != 1042";
    397 #       $sql = "SELECT COUNT(*) FROM summitExp WHERE dateobs > '$date' AND exp_type = '$expType[0]'";
    398         $qry2 = $projectdb->query($sql);
    399         $qry2->fetchInto($summit);
    400 
    401 
    402         $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name WHERE summitExp.dateobs > '$date' AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'";
    403         $qry2 = $projectdb->query($sql);
    404         $qry2->fetchInto($mhpcc);
    405 
    406         $sql = "SELECT COUNT(*) FROM summitExp join pzDownloadExp using (summit_id) WHERE dateobs > '$date' AND exp_type = '$expType[0]' and state = 'drop'";
    407         $qry2 = $projectdb->query($sql);
    408         $qry2->fetchInto($dropped);
    409 
    410 
    411         #Query with 30 minutes delay to check during the night if any exposures are missing.
    412         $datehour = gmdate("Y-m-d H:i:s");
    413         $sql = "SELECT COUNT(*) FROM summitExp left join pzDownloadExp using (summit_id) WHERE dateobs > '$date' AND dateobs <= date_sub('$datehour', interval 30 minute) AND exp_type = '$expType[0]' and (state != 'drop' or state is null) and fault != 1042";
    414         $qry2 = $projectdb->query($sql);
    415         $qry2->fetchInto($summitdelay);
    416 
    417         $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name WHERE summitExp.dateobs > '$date' AND summitExp.dateobs <= date_sub('$datehour', interval 30 minute) AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'";
    418         $qry2 = $projectdb->query($sql);
    419         $qry2->fetchInto($mhpccdelay);
    420 
    421         echo "<tr>";
    422 
    423         $DLdiff = $summit[0] - $mhpcc[0];
    424         if ($DLdiff == 0) $error = 0;
    425         else $error = 1;
    426 
    427         $delayDLdiff = $summitdelay[0] - $mhpccdelay[0];
    428         if ($delayDLdiff == 0) $errordelay = 0;
    429         else $errordelay = 1;
    430 
    431         echo "<td>$expType[0]</td>";
    432         echo "<td>$summit[0]</td>";
    433         #createFormattedTableCell("", "", $mhpcc[0], $error, 0);
    434         if ($delayDLdiff==0) {
    435            createFormattedTableCell("", "", $mhpcc[0], $error, 0);
    436         } else {
    437            $DLStatus = "<font style=\"BACKGROUND-COLOR: yellow\"  color=\"red\">$mhpcc[0] ($delayDLdiff)</font>";
    438            echo "<td>$DLStatus</td>";
    439         }
    440 
    441         echo "<td>$dropped[0]</td>";
    442 
    443         echo "</tr>";
    444     }
    445 
    446     echo "</table>\n";
    447 
    448 }
    449434
    450435###########################################################################
     
    455440function createChunkDataTable($projectdb) {
    456441
     442    // timer start
     443    $time = microtime();
     444    $time = explode(' ', $time);
     445    $time = $time[1] + $time[0];
     446    $start = $time;
     447
     448    // function begin
    457449    #First find the reference exposure ID to speed up the subsequent queries
    458450    $date = gmdate("Y-m-d");
     
    634626        echo "</tr>";
    635627    }
     628
     629
     630    // timer finished
     631    echo "<tr><th colspan=10>";
     632    $time = microtime();
     633    $time = explode(' ', $time);
     634    $time = $time[1] + $time[0];
     635    $finish = $time;
     636    $total_time = round(($finish - $start), 3);
     637    echo "loading in $total_time seconds.";
     638    $start= $finish;
     639    echo "</th></tr>";
    636640    echo "</table></br>";
    637641
     
    676680        $selectedLabel, $selectedStage, $plotType) {
    677681
     682    // timer start
     683    $time = microtime();
     684    $time = explode(' ', $time);
     685    $time = $time[1] + $time[0];
     686    $start = $time;
     687
     688    // function begin
    678689    $isUpdate = ($selectedMode == "update");
    679690    global $headerColor;
     
    799810
    800811    echo "</tr>\n";
    801     echo "</table>\n";
     812
     813    // timer finished
     814    echo "<tr><th colspan=11>";
     815    $time = microtime();
     816    $time = explode(' ', $time);
     817    $time = $time[1] + $time[0];
     818    $finish = $time;
     819    $total_time = round(($finish - $start), 3);
     820    echo "loading in $total_time seconds.";
     821    $start= $finish;
     822    echo "</th></tr>";
     823    echo "</table><br>";
    802824}
    803825
     
    947969function createDatesTable($db, $proj) {
    948970
     971    // timer start
     972    $time = microtime();
     973    $time = explode(' ', $time);
     974    $time = $time[1] + $time[0];
     975    $start = $time;
     976
     977    // function begin
    949978    global $table;
    950979    echo $table;
     
    959988    createServerDateRow($db, $proj, "registration");
    960989
    961     echo "</table>\n";
     990    // timer finished
     991    echo "<tr><th colspan=11>";
     992    $time = microtime();
     993    $time = explode(' ', $time);
     994    $time = $time[1] + $time[0];
     995    $finish = $time;
     996    $total_time = round(($finish - $start), 3);
     997    echo "loading in $total_time seconds.";
     998    $start= $finish;
     999    echo "</th></tr>";
     1000    echo "</table><br>";
     1001
    9621002}
    9631003
     
    10011041function createServersTable($pass, $proj, $selectedMode, $db, $servers, $selectedLabel, $selectedStage, $plotType) {
    10021042
     1043    // timer start
     1044    $time = microtime();
     1045    $time = explode(' ', $time);
     1046    $time = $time[1] + $time[0];
     1047    $start = $time;
     1048
     1049    // function begin
    10031050    // set up table columns
    10041051    global $table;
     
    10871134    }
    10881135
    1089     echo "</table>\n";
     1136    // timer finished
     1137    echo "<tr><th colspan=5>";
     1138    $time = microtime();
     1139    $time = explode(' ', $time);
     1140    $time = $time[1] + $time[0];
     1141    $finish = $time;
     1142    $total_time = round(($finish - $start), 3);
     1143    echo "loading in $total_time seconds.";
     1144    $start= $finish;
     1145    echo "</th></tr>";
     1146    echo "</table><br>\n";
    10901147}
    10911148
     
    11291186function getServerStatus($db,$proj, $server, &$alive, &$running) {
    11301187
    1131     $sql = "SELECT alive, running FROM science_servers WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY timestamp DESC LIMIT 1";
     1188#    $sql = "SELECT alive, running FROM science_servers WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY timestamp DESC LIMIT 1";
     1189    $sql = "SELECT alive, running FROM live_servers WHERE server LIKE '$server' AND telescope LIKE '$proj' ORDER BY timestamp DESC LIMIT 1";
    11321190    if($debug){echo "$sql<br>";}
    11331191
     
    12481306###########################################################################
    12491307function showPingStatus($Host, $DatabaseName) {
     1308    // timer start
     1309    $time = microtime();
     1310    $time = explode(' ', $time);
     1311    $time = $time[1] + $time[0];
     1312    $start = $time;
     1313
     1314    // function begin
    12501315    exec("ping -c 1 $Host", $res, $rval);
    12511316    if ($rval == 0){
     
    12541319      $PingStatus = "<font style=\"BACKGROUND-COLOR: yellow\"  color=\"red\">DOWN</font>";
    12551320    }
    1256     echo "<tr><td>$DatabaseName</td><td>$PingStatus</td></tr>";
    1257 }
    1258 
     1321    echo "<tr><td>$DatabaseName</td>";
     1322
     1323    echo "</td><td>$PingStatus</td>";
     1324    // timer finished
     1325    echo "<td>";
     1326    $time = microtime();
     1327    $time = explode(' ', $time);
     1328    $time = $time[1] + $time[0];
     1329    $finish = $time;
     1330    $total_time = round(($finish - $start), 3);
     1331    echo "$total_time seconds";
     1332    $start= $finish;
     1333    echo "</td></tr>";
     1334}
     1335
     1336
     1337###########################################################################
     1338#
     1339# Creates a table of summitExp against rawExp
     1340#
     1341###########################################################################
     1342function createSummitDataTable($projectdb) {
     1343
     1344    // timer start
     1345    $time = microtime();
     1346    $time = explode(' ', $time);
     1347    $time = $time[1] + $time[0];
     1348    $start = $time;
     1349
     1350    // function begin
     1351    $date = date("Y-m-d");
     1352    $sql = "SELECT DISTINCT exp_type FROM summitExp WHERE dateobs > '$date'";
     1353
     1354    $qry = $projectdb->query($sql);
     1355    if (dberror($qry)) {
     1356        echo "<b>error reading newExp table</b><br>\n";
     1357        echo "<br><small><b> table query : $sql </b></small><br>\n";
     1358        menu_end();
     1359    }
     1360
     1361    // set up the table
     1362    global $table;
     1363    echo $table;
     1364    echo "<tr>";
     1365    createTableTitle("Data status > $date", 4);
     1366    echo "<tr>";
     1367    createTableColumnHeader("Exposure type");
     1368    createTableColumnHeader("At summit");
     1369    createTableColumnHeader("Registered at MHPCC");
     1370    createTableColumnHeader("Summit (Drop/Null)");
     1371
     1372    $msg = "No science images taken since $date";
     1373
     1374    // list the results
     1375    while ($qry->fetchInto($expType)) {
     1376
     1377        $sql = "SELECT COUNT(*) FROM summitExp LEFT JOIN pzDownloadExp USING (summit_id)
     1378                WHERE dateobs > '$date' AND exp_type = '$expType[0]'";
     1379             //   AND state != 'drop' AND state is not null AND fault != 1042";
     1380        $qry2 = $projectdb->query($sql);
     1381        $qry2->fetchInto($summit);
     1382
     1383        $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name
     1384                WHERE summitExp.dateobs > '$date' AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'";
     1385        $qry2 = $projectdb->query($sql);
     1386        $qry2->fetchInto($mhpcc);
     1387
     1388        $sql = "SELECT COUNT(*) FROM summitExp LEFT JOIN pzDownloadExp USING (summit_id)
     1389                WHERE dateobs > '$date' AND exp_type = '$expType[0]' AND (state = 'drop' OR state is null)";
     1390        $qry2 = $projectdb->query($sql);
     1391        $qry2->fetchInto($dropped);
     1392
     1393
     1394        #Query with 30 minutes delay to check during the night if any exposures are missing.
     1395        $datehour = gmdate("Y-m-d H:i:s");
     1396        $sql = "SELECT COUNT(*) FROM summitExp LEFT JOIN pzDownloadExp USING (summit_id)
     1397                WHERE dateobs > '$date' AND dateobs <= date_sub('$datehour', interval 30 minute)
     1398                AND exp_type = '$expType[0]' AND (state != 'drop' OR state is null) and fault != 1042";
     1399
     1400        $qry2 = $projectdb->query($sql);
     1401        $qry2->fetchInto($summitdelay);
     1402
     1403        $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name
     1404                WHERE summitExp.dateobs > '$date' AND summitExp.dateobs <= date_sub('$datehour', interval 30 minute)
     1405                AND rawExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'";
     1406        $qry2 = $projectdb->query($sql);
     1407        $qry2->fetchInto($mhpccdelay);
     1408
     1409        echo "<tr>";
     1410
     1411        $DLdiff = $summit[0] - $mhpcc[0];
     1412        if ($DLdiff == 0) $error = 0;
     1413        else $error = 1;
     1414
     1415        $delayDLdiff = $summitdelay[0] - $mhpccdelay[0];
     1416        if ($delayDLdiff == 0) $errordelay = 0;
     1417        else $errordelay = 1;
     1418
     1419        echo "<td>$expType[0]</td>";
     1420        echo "<td>$summit[0]</td>";
     1421        if ($delayDLdiff==0) {
     1422           createFormattedTableCell("", "", $mhpcc[0], $error, 0);
     1423        } else {
     1424           $DLStatus = "<font style=\"BACKGROUND-COLOR: yellow\"  color=\"red\">$mhpcc[0] ($delayDLdiff)</font>";
     1425           echo "<td>$DLStatus</td>";
     1426        }
     1427
     1428        echo "<td>$dropped[0]</td>";
     1429
     1430        echo "</tr>";
     1431    }
     1432
     1433    // timer finished
     1434    echo "<tr><th colspan=4>";
     1435    $time = microtime();
     1436    $time = explode(' ', $time);
     1437    $time = $time[1] + $time[0];
     1438    $finish = $time;
     1439    $total_time = round(($finish - $start), 3);
     1440    echo "loading in $total_time seconds.";
     1441    $start= $finish;
     1442    echo "</th></tr>";
     1443    echo "</table><br>";
     1444}
     1445
     1446
     1447function createSummitDataTable2($projectdb) {
     1448
     1449    // timer start
     1450    $time = microtime();
     1451    $time = explode(' ', $time);
     1452    $time = $time[1] + $time[0];
     1453    $start = $time;
     1454
     1455    // function begin
     1456    $date = date("Y-m-d");
     1457    // set up the table
     1458    global $table;
     1459    global $columnHeaderColor;
     1460    echo $table;
     1461    echo "<tr>";
     1462    createTableTitle("Data status > $date", 4);
     1463    echo "<tr>";
     1464    createTableColumnHeader("Exp_type at summit");
     1465    createTableColumnHeader("Status at summit");
     1466    createTableColumnHeader("Status at mhpcc");
     1467    createTableColumnHeader("Number");
     1468    $sql = "SELECT summitExp.exp_type,pzDownloadExp.state,rawExp.state,COUNT(*) FROM summitExp
     1469            LEFT JOIN pzDownloadExp USING (summit_id) LEFT JOIN rawExp on summitExp.exp_name = rawExp.exp_name
     1470            WHERE summitExp.dateobs > '$date' group by summitExp.exp_type,pzDownloadExp.state,rawExp.state";
     1471    $qry = $projectdb->query($sql);
     1472    while ($qry->fetchInto($tmp)) {
     1473        if ($tmp[1] == NULL) {
     1474          echo  "<tr><td>$tmp[0]<td> null <td> null <td bgcolor=\"yellow\"> <font color=\"red\">$tmp[3]";
     1475        }
     1476        else {
     1477          if ($tmp[1] == 'run') {
     1478            echo  "<tr><td>$tmp[0]<td> loading <td> null <td bgcolor=$columnHeaderColor> <font color=\"red\">$tmp[3]";
     1479          }
     1480          else {
     1481            if ($tmp[2] == NULL) {
     1482              echo  "<tr><td>$tmp[0] <td> $tmp[1] <td> loading <td bgcolor=$columnHeaderColor> <font color=\"blue\">$tmp[3]";
     1483            }
     1484            else {
     1485              echo  "<tr><td>$tmp[0]<td> $tmp[1] <td> downloaded <td> $tmp[3]";
     1486            }
     1487          }
     1488        }
     1489    }
     1490
     1491    // timer finished
     1492    echo "<tr><th colspan=4>";
     1493    $time = microtime();
     1494    $time = explode(' ', $time);
     1495    $time = $time[1] + $time[0];
     1496    $finish = $time;
     1497    $total_time = round(($finish - $start), 3);
     1498    echo "loading in $total_time seconds.";
     1499    $start= $finish;
     1500    echo "</th></tr>";
     1501    echo "</table><br>";
     1502}
    12591503?>
    12601504
  • trunk/ippMonitor/raw/site.php.in

    r41126 r41135  
    1313$DBI     = "@DBI@";
    1414
     15// location of plots produced by czarpoll.pl
     16$CZARPLOTDIR     = "./czartool_plots";
     17$METRICSPLOTDIR  = "./ippMetrics";
     18
    1519// insert config.dat here. this contains a number of system-specific things like
    1620// the names of database machines and users
    17 
    18 // location of plots produced by czarpoll.pl
    19 $CZARPLOTDIR     = "/export/@HOST2@.0/ipp/czartool_plots";
    20 $METRICSPLOTDIR  = "/export/@HOST2@.0/ipp/ippMetrics";
    2121
    2222@CONFIG.DAT@
Note: See TracChangeset for help on using the changeset viewer.