IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42819


Ignore:
Timestamp:
May 8, 2025, 4:08:38 PM (12 months ago)
Author:
eugene
Message:

merge from trunk: plotting improvements

Location:
branches/eam_branches/ipp-20230313/ippMonitor
Files:
11 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/ippMonitor

  • branches/eam_branches/ipp-20230313/ippMonitor/INSTALL

    r42546 r42819  
    3939# $CZARPLOTDIR and $METRICSPLOTDIR will be generated as links in the same folder as ippMonitor 
    4040# the structure of the names for these two directories are defined in Makefile.in a
    41 psconfigure --htdocs /var/www/localhost/htdocs --wwwbin /var/www/localhost/wwwbin --pltdir /some/path --site ~/ippconfig/ippmonitor.config --usePDO
     41
     42# pltdir is for ippMetrics and czartool_plots hyperlinked from /export/ipp113.0/ipp/ in /var/www/localhost/htdocs/ippMonitor
     43# pltdir in ipp117 is /var/www/localhost/htdocs/ippMonitor
     44# ippMetrics -> /export/ipp113.0/ipp/ippMetrics/
     45# czartool_plots -> /export/ipp113.0/ipp/czartool_plots/
     46# --usePDO selects a modern PHP/mysql interface
     47psconfigure --htdocs /var/www/localhost/htdocs --wwwbin /var/www/localhost/wwwbin --pltdir /var/www/localhost/htdocs/ippMonitor --site ~/ippconfig/ippmonitor.config --usePDO
    4248
    4349# note that modern php requires the use of PDO, the older MDB2 and DB mysql interfaces have been deprecated
  • branches/eam_branches/ipp-20230313/ippMonitor/Makefile.in

    r42751 r42819  
    9191$(DESTWWW)/scatterPlotAirmassMcal.php \
    9292$(DESTWWW)/scatterPlotDataQuality.php \
     93$(DESTWWW)/dataquality.php \
     94$(DESTWWW)/pointing.php \
    9395$(DESTWWW)/loader.js
    9496
  • branches/eam_branches/ipp-20230313/ippMonitor/czartool/czarpoll.pl

    r41302 r42819  
    380380        }
    381381
     382        # check ippdb host IPP-2338
     383        print "* Checking ippdb hosts\n";
     384        my @hosts = qw(ipphome0 ipphome1 ippdb01 ippdb05 ippdb06 ippdb09 ippdb11 ippdb12 ippdb13 ippdb14);
     385        if($dbupdate == 1) {check_disk_usage_and_update($czarDb, @hosts);}
     386
    382387        # check pantasks status
    383388        if($dbupdate == 1) {updateServerStatus();}
     
    604609}
    605610
     611###########################################################################
     612#
     613# Loops through given host and update to the host list
     614#
     615###########################################################################
     616sub check_disk_usage_and_update {
     617    my ($czarDb, @hosts) = @_;
     618
     619    foreach my $host (@hosts) {
     620        print "Checking $host...\n";
     621
     622        for my $suffix (0, 1) {
     623            my $mount_point = "/export/$host.$suffix";
     624
     625            # Use SSH to get disk stats
     626            my $df_output = `ssh $host df -k $mount_point 2>/dev/null`;
     627
     628            #if (!$df_output || $df_output !~ /\d/) {
     629            #    warn "Failed to get disk usage for $host on $mount_point\n";
     630            #    next;
     631            #}
     632
     633            my @lines = split /\n/, $df_output;
     634            my $line = $lines[1] || next;
     635
     636            my ($filesystem, $blocks, $used, $available, $percent, $mount) = split /\s+/, $line;
     637
     638            # Convert KB to TB
     639            my $total_tb     = sprintf("%.1f", $blocks    / 1024 / 1024 / 1024);
     640            my $used_tb      = sprintf("%.1f", $used      / 1024 / 1024 / 1024);
     641            my $available_tb = sprintf("%.1f", $available / 1024 / 1024 / 1024);
     642
     643            my $used_percent      = sprintf("%.3f", $used / $blocks * 100);
     644            my $available_percent = sprintf("%.3f", $available / $blocks * 100);
     645
     646            my $readable = 1;
     647            my $writable = 1;
     648
     649            #print "Mount $mount_point: total=${total_tb}TB, used=${used_tb}TB (${used_percent}%), available=${available_tb}TB (${available_percent}%)\n";
     650
     651            # Example: ippdb01.0(3.5T)
     652            my $host_label = "$host.$suffix(${total_tb}T)";
     653            $czarDb->updateHost($host_label, 100, $available_percent, $used_percent, $readable, $writable);
     654        }
     655    }
     656}
  • branches/eam_branches/ipp-20230313/ippMonitor/czartool/czartool/Nebulous.pm

    r39805 r42819  
    111111
    112112            next;
    113         } elsif (($line =~ m/(ipp[0-9]+\.[0-9]{1})\s.+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)%.*/i)||
     113        } elsif (($line =~ m/(ipp[0-9]+(?:_bck)?\.[0-9]{1})\s.+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)%.*/i)||
    114114               ($line =~ m/(ippb[0-9]+\.[0-9]{1})\s.+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)%.*/i)
    115115# these nodes are gone
  • branches/eam_branches/ipp-20230313/ippMonitor/czartool/czartool/Pantasks.pm

    r41558 r42819  
    1010        "cleanup",
    1111        "distribution",
    12         "pstamp",
     12        "ippitc:pstamp",
    1313        "registration",
    1414        "stack",
     
    2222        "ippqub:stdscience_ws",
    2323        "ippqub2:stdscience_ws",
     24        "ippsky:stdscience_ipp138",
    2425        "publishing",
    2526        "replication",
     
    2728        );
    2829# current home dir of gpc1 and gpc2
    29 my $ipphome1 = "/home/panstarrs/ippitc";
     30my $ipphome1 = "/home/panstarrs/ippps1";
    3031my $ipphome2 = "/home/panstarrs/ippps2";
    3132
  • branches/eam_branches/ipp-20230313/ippMonitor/czartool/extra_labels.dat

    r41125 r42819  
    11## TdB20190626: add extra labels for processing in this file. Syntax is as follows: [labelname] [telescope]
    22## Priorities for the labels must be added to the priorities mySQL table for the relevant telescope, if desired.
    3 PV3.Pole.Reprocess.20180510 gpc1
     3## PV3.Pole.Reprocess.20180510 gpc1
    44ps_ud_QUB gpc1
     5## update.ipp138.fix gpc1
     6## update.ipp138.fix gpc2
  • branches/eam_branches/ipp-20230313/ippMonitor/raw/czartool_labels.php

    r42751 r42819  
    8787        "distribution",
    8888        "ippqub:stdscience_ws",
    89         "pstamp",
     89        "ippitc:pstamp",
    9090        "registration",
    9191//        "stack",
     
    16681668    $qry = $db->query($sql);
    16691669    if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";}
     1670
     1671    // Set environment variables
     1672    putenv("PATH=/usr/local/bin:/usr/bin:/bin:/data/ippc65.0/ipp/src/psconfig//ipp-20210708-gentoo.lin64/bin");
     1673    putenv("PERL5LIB=/data/ippc65.0/ipp/src/psconfig//ipp-20210708-gentoo.lin64/lib");
     1674
    16701675    # not sure why neb-host doesn't work on ipp113 CCL.20210216
    16711676    exec("neb-host |cut -b 17-30,86-", $hostnoteall);
  • branches/eam_branches/ipp-20230313/ippMonitor/raw/ipp.czar.dat

    r42276 r42819  
    55menulink   | menuselect      | link    | czartool               | czartool_labels.php
    66menulink   | menuselect      | link    | storage status         | storage.php
     7menulink   | menuselect      | link    | pointing               | pointing.php
     8menulink   | menuselect      | link    | data quality           | dataquality.php
    79menulink   | menuselect      | link    | mask stats             | maskStats.php
    810menulink   | menuselect      | link    | night summary          | nightSummary.php
  • branches/eam_branches/ipp-20230313/ippMonitor/raw/ipp.php

    r42751 r42819  
    982982}
    983983
    984 
    985 
    986984?>
  • branches/eam_branches/ipp-20230313/ippMonitor/scripts/czartool_getServerStatus.pl

    r41726 r42819  
    1919
    2020if ($proj eq 'gpc1') {
    21   $user = 'ippitc';
     21  $user = 'ippps1';
    2222} else {
    2323  $user = 'ippps2';
     24}
     25
     26my @cmdOut3 = `grep PANTASKS_SERVER ~$user/$server/ptolemy.rc |grep -v std | grep -v PORT 2>&1`;
     27my $line3;
     28foreach $line3 (@cmdOut3) {
     29    chomp($line3);
     30    print "$line3 \n";
    2431}
    2532
     
    4047    my @fields = split /\s+/, $line2;
    4148
     49
    4250#    run job example
    4351# field0      1        2       3         4      5       6           7       8
     
    5058    $nline = $nline + 1;
    5159}
     60
     61
Note: See TracChangeset for help on using the changeset viewer.