Index: /trunk/ippMonitor/czartool/czarpoll.pl
===================================================================
--- /trunk/ippMonitor/czartool/czarpoll.pl	(revision 42922)
+++ /trunk/ippMonitor/czartool/czarpoll.pl	(revision 42923)
@@ -260,9 +260,9 @@
         $pantasks->getServerStatus($server,'gpc1', \$alive, \$running, \$pan_host);
         $czarDb->updateServerStatusLive($server,'gpc1', $alive, $running, $pan_host);
-        print "Server: $server | Telescope: gpc1 | Alive: $alive | Running: $running | Host: " . (defined $pan_host ? $pan_host : "undef") . "\n";
+        #print "Server: $server | Telescope: gpc1 | Alive: $alive | Running: $running | Host: " . (defined $pan_host ? $pan_host : "undef") . "\n";
         # For gpc2
         $pantasks->getServerStatus($server,'gpc2', \$alive, \$running, \$pan_host);
         $czarDb->updateServerStatusLive($server,'gpc2', $alive, $running, $pan_host);
-        print "Server: $server | Telescope: gpc2 | Alive: $alive | Running: $running | Host: " . (defined $pan_host ? $pan_host : "undef") . "\n";
+        #print "Server: $server | Telescope: gpc2 | Alive: $alive | Running: $running | Host: " . (defined $pan_host ? $pan_host : "undef") . "\n";
    }
 }
@@ -318,9 +318,9 @@
         if($timediff > 120.) { 
             print "There is no recent Czarpoll iteration\n";
-            print "* Updating database entries*\n";
+            print "== Updating database entries ==\n";
             $dbupdate = 1;
         } else {
             print "There is a recent Czarpoll iteration already made ($timediff sec ago)\n";
-            print "* Skipping database queries and entries\n";
+            print "== Skipping database queries and entries ==\n";
             $dbupdate = 0;
         }
@@ -390,5 +390,5 @@
         # check ippdb host IPP-2338
         print "* Checking ippdb hosts\n";
-        my @hosts = qw(ipphome0 ipphome1 ippdb01 ippdb05 ippdb06 ippdb09 ippdb11 ippdb12 ippdb13 ippdb14);
+        my @hosts = qw(ipphome2 ipphome3 ippdb01 ippdb05 ippdb06 ippdb09 ippdb11 ippdb12 ippdb13 ippdb14);
         if($dbupdate == 1) {check_disk_usage_and_update($czarDb, @hosts);}
 
@@ -626,5 +626,5 @@
 
     foreach my $host (@hosts) {
-        print "Checking $host...\n";
+        print " - Checking $host...\n";
 
         for my $suffix (0, 1) {
@@ -654,11 +654,17 @@
             my $readable = 1;
             my $writable = 1;
-            my $xattr = 0;
+            my $xattr = 9;
 
             #print "Mount $mount_point: total=${total_tb}TB, used=${used_tb}TB (${used_percent}%), available=${available_tb}TB (${available_percent}%)\n";
 
-            # Example: ippdb01.0(3.5T)
-            #my $host_label = "$host.$suffix(${total_tb}T)";
             my $host_label = "$host.$suffix";
+
+            # --- Skip update if total TB < 1 ---
+            if ($total_tb < 1) {
+                warn " ! Skipping $host_label because total TB ($total_tb) < 1\n";
+                next;
+            }
+
+            # Update host in DB
             $czarDb->updateHost($host_label, $total_tb, $available_tb, $used_tb, $readable, $writable, $xattr);
         }
Index: /trunk/ippMonitor/czartool/czartool/CzarDb.pm
===================================================================
--- /trunk/ippMonitor/czartool/czartool/CzarDb.pm	(revision 42922)
+++ /trunk/ippMonitor/czartool/czartool/CzarDb.pm	(revision 42923)
@@ -175,18 +175,32 @@
 ###########################################################################
 sub updateServerStatusLive {
+
     my ($self, $server,$telescope, $alive, $running, $pan_host) = @_;
 
-    my $query = $self->{_db}->prepare(<<SQL);
-    DELETE FROM live_servers where timestamp < CURRENT_TIMESTAMP - INTERVAL 12 hour;
-SQL
-       $query->execute;
-
-    $query = $self->{_db}->prepare(<<SQL);
-    INSERT INTO live_servers
-        (server,telescope, alive, running, host)
-        VALUES
-        ('$server','$telescope', $alive, $running, '$pan_host');
-SQL
-       $query->execute;
+    # --- Provide defaults if undefined ---
+    $server    = defined $server    ? $server    : '';  # empty string if undef
+    $telescope = defined $telescope ? $telescope : '';  # empty string if undef
+    $alive     = defined $alive     ? $alive     : 0;   # default 0 if undef
+    $running   = defined $running   ? $running   : 0;   # default 0 if undef
+    $pan_host  = defined $pan_host  ? $pan_host  : '';  # empty string if undef
+
+    ## Debug print so you can see the values
+    #warn sprintf(
+    #    "server=%s telescope=%s alive=%s running=%s pan_host=%s\n",
+    #    $server, $telescope, $alive, $running, $pan_host
+    #);
+
+    # --- Delete old records ---
+    my $query = $self->{_db}->prepare(
+        'DELETE FROM live_servers WHERE timestamp < CURRENT_TIMESTAMP - INTERVAL 12 HOUR'
+    );
+    $query->execute or die $query->errstr;
+
+    $query = $self->{_db}->prepare(
+        'INSERT INTO live_servers (server, telescope, alive, running, host)
+         VALUES (?, ?, ?, ?, ?)'
+    );
+    $query->execute($server, $telescope, $alive, $running, $pan_host);
+
 }
 
Index: /trunk/ippMonitor/czartool/czartool/Nebulous.pm
===================================================================
--- /trunk/ippMonitor/czartool/czartool/Nebulous.pm	(revision 42922)
+++ /trunk/ippMonitor/czartool/czartool/Nebulous.pm	(revision 42923)
@@ -122,5 +122,5 @@
 
             $self->getReadableWritableStatus($1, \$readable, \$writable, \$xattr);
-            print "Host: $1, Readable: $readable, Writable: $writable, Xattr: $xattr\n";
+            #print "Host: $1, Readable: $readable, Writable: $writable, Xattr: $xattr\n";
 
 
Index: /trunk/ippMonitor/czartool/czartool/Pantasks.pm
===================================================================
--- /trunk/ippMonitor/czartool/czartool/Pantasks.pm	(revision 42922)
+++ /trunk/ippMonitor/czartool/czartool/Pantasks.pm	(revision 42923)
@@ -109,5 +109,5 @@
     my $today = sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day);
 
-    print "stdscience : $ipphome/stdscience/ptolemy.rc\n";
+    #print "stdscience : $ipphome/stdscience/ptolemy.rc\n";
     my @cmdOut = `echo "ns.show.dates;quit" | pantasks_client -c $ipphome/stdscience/ptolemy.rc 2>&1`;
     my $line;
Index: /trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- /trunk/ippMonitor/raw/czartool_labels.php	(revision 42922)
+++ /trunk/ippMonitor/raw/czartool_labels.php	(revision 42923)
@@ -1827,15 +1827,4 @@
     $start = microtime(true);
 
-    echo "<script type=\"text/javascript\" src=\"loader.js\"></script>";
-    echo "<br><div class=\"chartWithOverlay\" style=\"position: relative; width: 100%\">";
-    echo "  <div id=\"disk_div\" style=\"width:100%; height:5000px\"></div>";
-    echo "  <div class=\"overlay\" style=\"position: absolute; width: 100px; top: 50px; right: 20px;\">";
-    echo "    <div style=\"font-size: 12px; height: 14px; border: 1px solid; background-color: lightgreen\"><center>Free</div>";
-    echo "    <div style=\"font-size: 12px; height: 14px; border: 1px solid; background-color: yellow\"><center>Used</div>";
-    echo "    <div style=\"font-size: 12px; height: 14px; border: 1px solid; background-color: pink\"><center>> 97% limit</div>";
-    echo "    <div style=\"font-size: 12px; height: 14px; border: 1px solid; background-color: lightgrey\"><center>Down | Repair</div>";
-    echo "    <div style=\"font-size: 12px; height: 14px; border: 1px solid; background-color: white\"><center>Offline</div>";
-    echo "  </div>";
-    echo "</div>";
 
     // Set environment variables
@@ -1943,5 +1932,5 @@
                     legend: { position: 'none', alignment: 'end', maxLines: 3 },
                     hAxis: { title: 'Space (TB)', gridlines: {count: 20} },
-                    vAxis: { textStyle: {fontSize: 14}, format: 'string',  textPosition: 'in', direction: 1},
+                    vAxis: { textStyle: {fontSize: 15}, format: 'string',  textPosition: 'in', direction: 1},
                     bar: { groupWidth: '95%' },
                     chartArea: {left:40, top:50, right:20, bottom:40},
@@ -1955,4 +1944,25 @@
             }
           </script>";
+
+echo "<script type='text/javascript' src='loader.js'></script>
+<br>
+<div class='chartWithOverlay' style='position: relative; width: 100%'>
+
+    <div id='disk_div' style='width:100%; height:5000px'></div>
+
+    <div class='overlay' style='position: absolute; width:160px; top:50px; right:30px; font-family:Arial, sans-serif;'>
+
+      <div style='font-size:15px; border:1px solid #888; background-color:lightgreen; color:black; text-align:center; margin-bottom:1px;'>Free</div>
+      <div style='font-size:15px; border:1px solid #888; background-color:yellow    ; color:black; text-align:center; margin-bottom:1px;'>Used</div>
+      <div style='font-size:15px; border:1px solid #888; background-color:pink      ; color:black; text-align:center; margin-bottom:1px;'>97% Usage</div>
+      <div style='font-size:15px; border:1px solid #888; background-color:lightgrey ; color:black; text-align:center; margin-bottom:1px;'>Down/Repair</div>
+      <div style='font-size:15px; border:1px solid #888; background-color:white     ; color:black; text-align:center; margin-bottom:1px;'>Offline</div>
+      <div style='font-size:15px; border:1px solid #888; background-color:#42a5f5   ; color:white; text-align:center; margin-bottom:1px;'>
+        <a href='https://atrcganglia.ifa.hawaii.edu/' target='_blank' style='text-decoration:none; color:white; font-weight:bold;'>ATRC ganglia</a>
+      </div>
+
+    </div>
+
+</div>";
 
     $total_time = round(microtime(true) - $start, 3);
Index: /trunk/ippMonitor/raw/storage.php
===================================================================
--- /trunk/ippMonitor/raw/storage.php	(revision 42922)
+++ /trunk/ippMonitor/raw/storage.php	(revision 42923)
@@ -58,5 +58,5 @@
     exec("neb-host |cut -b 17-30,86-", $hostnoteall);
 
-    $sql = "SELECT host, format(total, 2), format(available, 2), format(used, 2), writable, readable, format(used/total*100,3) as ratio FROM hosts where xattr <> 3 ORDER BY CASE WHEN ROUND(used/total*100,3) = 100 THEN 0 ELSE 1 END, CASE WHEN host LIKE '%\_bck.0' THEN 1 ELSE 0 END, host;";
+    $sql = "SELECT host, format(total, 2), format(available, 2), format(used, 2), writable, readable, format(used/total*100,3) as ratio FROM hosts where xattr <> 3 ORDER BY CASE WHEN ROUND(used/total*100,3) = 100 THEN 0 ELSE 1 END, xattr, host;";
     $qry = $db->query($sql);
 
