Ben,
As you probably already know, the code is in header.php -
if( $context == "cluster" )
{
if (!count($metrics)) {
echo "<h4>Cannot find any metrics for selected cluster
\"$clustername\", exiting.</h4>\n";
echo "Check ganglia XML tree (telnet $ganglia_ip
$ganglia_port)\n";
exit;
}
$firsthost = key($metrics);
foreach ($metrics[$firsthost] as $m => $foo)
$context_metrics[] = $m;
foreach ($reports as $r => $foo)
$context_metrics[] = $r;
}
---------------------------------------------
So what to do?
Hack header.php about line 417 like this:
# $firsthost = key($metrics);
# foreach ($metrics[$firsthost] as $m => $foo)
# $context_metrics[] = $m;
foreach($rgmetrics as $m => $foo) {
$context_metrics[] = $m;
}
foreach ($reports as $r => $foo)
$context_metrics[] = $r;
}
---------------------------------------------
Fill the rgmetric array in ganglia.php:
$rgmetrics = array(); # Global decl.
In function start_cluster:
function start_cluster ($parser, $tagname, $attrs)
{
global $metrics, $cluster, $self, $grid, $hosts_up, $hosts_down;
global $rgmetrics; # decl.
and a little furth down in start_cluster function:
case "METRIC":
$metricname = $attrs[NAME];
$metrics[$hostname][$metricname] = $attrs;
$rgmetrics[$metricname] = $metricname;
break;
I would make a patch but my code is modded already.
This was also, errm, realtime programming - I did it just then.
Let me know if this is enough...
regards,
Richard
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ben
Hartshorne
Sent: 04 May 2006 08:00
To: [email protected]
Subject: [Ganglia-general] Metric pull-down menu not showing all metrics
All,
I am curious how the Metric menu in the cluster view gets populated. I
have a number of my hosts reporting metrics that the others don't. For
example, the hosts that are running mysql and replicating from a
different database report how many seconds they are behind their master,
but only 10 out of my 30 hosts run mysql.
The mysql_slave ganglia metric does not usually show in the Metric
pull-down menu.
Previously, I had only one cluster, so clicking on 'Grid' just went
straight to the cluster. For some reason, after clicking on 'Grid', I
could see all the metrics that are reported. As soon as I chose a
metric, only some of the metrics were present in the Metric pull-down
menu. I think only the metrics present on the first host in the cluster
list are present in the pull-down menu.
Now I have more than one cluster in my grid, so clicking on Grid no
longer gives me all the metrics in the Metric menu. I am now unable to
see my mysql_slave metric without manually typing it into the URL
string.
Suggestions?
-ben
--
Ben Hartshorne
email: [EMAIL PROTECTED]
http://ben.hartshorne.net
------------------------------------------------------------------------
For more information about Barclays Capital, please
visit our web site at http://www.barcap.com.
Internet communications are not secure and therefore the Barclays
Group does not accept legal responsibility for the contents of this
message. Although the Barclays Group operates anti-virus programmes,
it does not accept responsibility for any damage whatsoever that is
caused by viruses being passed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of the
Barclays Group. Replies to this email may be monitored by the Barclays
Group for operational or business reasons.
------------------------------------------------------------------------