> When one of the 70 nodes goes down, I can see only 5 summary
> graphs for that node. I cannot see the graphs for all the metrics from that
> 'down' node. Is that a bug? Is there a way to get those graphs?
If I am reading your email correctly, then what you want is the ability to
see the graphs for all the metrics prior to the host going down. That way
you can look to see if there was an anomoly leading up to the time when
the host went down. Is that about right?
If so, then that is exactly what I wanted too :-) I modifed the web
interface a bit to get this behavior. As it stands, ganglia assumes that
if the host is down, then there is no need to go on. As a result, it
stops processing the node's page before it gets to the graphs. Below is a
patch I used to force ganglia to proceed. Of course, there is some metric
info that makes no sense if a node is down, so I had that stuff skipped.
Warning: I have made several changes to the web interface, so I do not
know if my patch will apply cleanly to the original ganglia-web sources
(or just my modified ones). But if nothing else, it may help you find out
where to start making the changes on your own system.
--Rick
--------------------------
Rick Mohr
Systems Developer
Ohio Supercomputer Center
diff -Naur ganglia-3.0.1-orig/web/functions.php ganglia-3.0.1/web/functions.php
--- ganglia-3.0.1-orig/web/functions.php 2005-07-20 11:36:51.000000000
-0400
+++ ganglia-3.0.1/web/functions.php 2005-07-20 13:20:42.000000000 -0400
@@ -170,6 +170,8 @@
# the load/death of a cluster node
function node_image ($metrics)
{
+ global $host_is_up;
+
$cpu_num = $metrics["cpu_num"]['VAL'];
if(!$cpu_num || $cpu_num == 0)
{
@@ -179,8 +181,7 @@
$value = $load_one / $cpu_num;
# Check if the host is down
- # RFM - Added isset() check to eliminate error messages in ssl_error_log
- if (isset($hosts_down) and $hosts_down)
+ if (! $host_is_up)
$image = template("images/node_dead.jpg");
else
$image = load_image("node", $value);
diff -Naur ganglia-3.0.1-orig/web/ganglia.php ganglia-3.0.1/web/ganglia.php
--- ganglia-3.0.1-orig/web/ganglia.php 2005-07-20 11:36:51.000000000 -0400
+++ ganglia-3.0.1/web/ganglia.php 2005-07-20 13:20:42.000000000 -0400
@@ -26,6 +26,10 @@
# 2Key = "Cluster Name / Host Name" ... Value = Array of Host Attributes
$hosts_down = array();
+# RFM - Keep track of a single host's state (up or down)
+$host_is_up = 0;
+$this_host = array();
+
# Context dependant structure.
$metrics = array();
@@ -192,6 +196,7 @@
function start_host ($parser, $tagname, $attrs)
{
global $metrics, $cluster, $hosts_up, $hosts_down, $self, $grid;
+ global $host_is_up, $this_host;
switch ($tagname)
{
@@ -208,9 +213,17 @@
case "HOST":
if (host_alive($attrs, $cluster))
- $hosts_up = $attrs;
+ {
+ $hosts_up = $attrs;
+ $host_is_up = 1;
+ $this_host = $attrs;
+ }
else
- $hosts_down = $attrs;
+ {
+ $hosts_down = $attrs;
+ $host_is_up = 0;
+ $this_host = $attrs;
+ }
break;
case "METRIC":
diff -Naur ganglia-3.0.1-orig/web/host_view.php ganglia-3.0.1/web/host_view.php
--- ganglia-3.0.1-orig/web/host_view.php 2005-07-20 11:36:51.000000000
-0400
+++ ganglia-3.0.1/web/host_view.php 2005-07-20 13:20:42.000000000 -0400
@@ -11,7 +11,7 @@
$tpl->assign("sort",$sort);
$tpl->assign("range",$range);
-if($hosts_up)
+if($host_is_up)
$tpl->assign("node_msg", "This host is up and running.");
else
$tpl->assign("node_msg", "This host is down.");
@@ -24,11 +24,13 @@
$tpl->assign("node_view","./?p=2&c=$cluster_url&h=$hostname");
# No reason to go on if this node is down.
-if ($hosts_down)
- {
- $tpl->printToScreen();
- return;
- }
+# RFM - We still want to see the state of the system before the node
+# went down.
+#if ($hosts_down)
+# {
+# $tpl->printToScreen();
+# return;
+# }
$tpl->assign("ip", $hosts_up['IP']);
@@ -60,17 +62,23 @@
$g_metrics[$name]['graph'] = $graphargs;
}
}
+
# Add the uptime metric for this host. Cannot be done in ganglia.php,
# since it requires a fully-parsed XML tree. The classic contructor problem.
-$s_metrics['uptime']['TYPE'] = "string";
-$s_metrics['uptime']['VAL'] = uptime($cluster['LOCALTIME'] -
$metrics['boottime']['VAL']);
+if($host_is_up) {
+ $s_metrics['uptime']['TYPE'] = "string";
+ $s_metrics['uptime']['VAL'] = uptime($cluster['LOCALTIME'] -
$metrics['boottime']['VAL']);
+}
# Add the gmond started timestamps & last reported time (in uptime format) from
# the HOST tag:
-$s_metrics['gmond_started']['TYPE'] = "timestamp";
-$s_metrics['gmond_started']['VAL'] = $hosts_up['GMOND_STARTED'];
+if($host_is_up) {
+ $s_metrics['gmond_started']['TYPE'] = "timestamp";
+ $s_metrics['gmond_started']['VAL'] = $hosts_up['GMOND_STARTED'];
+}
+
$s_metrics['last_reported']['TYPE'] = "string";
-$s_metrics['last_reported']['VAL'] = uptime($cluster['LOCALTIME'] -
$hosts_up['REPORTED']);
+$s_metrics['last_reported']['VAL'] = uptime($cluster['LOCALTIME'] -
$this_host['REPORTED']);
# Show string metrics
if (is_array($s_metrics))