The following proposed patch for stable 3.1, completes the fix for BUG36
committed in r1244 to display correctly the time since the last received
heartbeat for a node that is down and as detailed in :

  http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=36

The template for the show_node page has been changed to display a message to
report if the cluster is down (as that will freeze the counter) and to display
the counter using an uptime format if older than 1 hour (as used elsewhere) so
that the observed downtime from a node could be quickly identified.

Contains changes from r1248, r1249 and r1318.

Carlo

---
Index: web/templates/default/show_node.tpl
===================================================================
--- web/templates/default/show_node.tpl (revision 1318)
+++ web/templates/default/show_node.tpl (working copy)
@@ -15,8 +15,9 @@
    <i>{ip}</i><br>
    <em>Location:</em> {location}<p>
 
-   Last heartbeat received {age} ago.{down}<br>
-   Uptime {uptime}
+   Last heartbeat received {age} ago.<br>
+   Uptime {uptime}<br>
+   {message}
 
    </td>
    <td align=right valign=top>
Index: web/show_node.php
===================================================================
--- web/show_node.php   (revision 1318)
+++ web/show_node.php   (working copy)
@@ -69,11 +69,15 @@
 $clustertime=$cluster['LOCALTIME'];
 $heartbeat=$hostattrs['REPORTED'];
 $age = $clustertime - $heartbeat;
-$s = ($age>1) ? "s" : "";
-$tpl->assign("age","$age second$s");
-if (!$up) {
-   $tpl->assign("down","<br><b>This node is down.</b>");
+if ($age > 3600) {
+   $tpl->assign("age", uptime($age));
+} else {
+   $s = ($age > 1) ? "s" : "";
+   $tpl->assign("age", "$age second$s");
 }
+if ((!$up) && ($cluster['HOSTS_UP'] == 0)) {
+   $tpl->assign("message","<b>This cluster is down.</b>");
+}
 
 # The these hardware units should be more flexible.
 $s = ($cpu_num>1) ? "s" : "";
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to