I was hoping that someone would do it properly! If I get time today I will get the patch working against 3.0.3
- richard -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rick Mohr Sent: 04 May 2006 15:08 To: [email protected] Subject: RE: [Ganglia-general] Metric pull-down menu not showing all metrics Ben, Below is the patch I created to display all metrics regardless of which hosts might have different sets of metrics. It is essentially the same modifications that Richard previously described (I had just chosen a different variable name). However, it is a patch against 3.0.1 and not the latest version, so I don't know if it will apply cleanly. Luckily, the patch is very simple so there shouldn't be any problems getting it to work with the latest version. Hope that helps. --Rick -------------------------- Rick Mohr Systems Developer Ohio Supercomputer Center ----- BEGIN PATCH ----- 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 09:58:33.000000000 -0400 +++ ganglia-3.0.1/web/ganglia.php 2005-07-20 11:23:14.000000000 -0400 @@ -29,6 +29,10 @@ # Context dependant structure. $metrics = array(); +# RFM - We want to keep track of all metrics even if different ones # +appear on different nodes. $metric_names = array(); + # 1Key = "Component" (gmetad | gmond) = Version string $version = array(); @@ -108,7 +112,7 @@ function start_cluster ($parser, $tagname, $attrs) { - global $metrics, $cluster, $self, $grid, $hosts_up, $hosts_down; + global $metrics, $metric_names, $cluster, $self, $grid, $hosts_up, + $hosts_down; static $hostname; switch ($tagname) @@ -145,6 +149,7 @@ case "METRIC": $metricname = $attrs['NAME']; $metrics[$hostname][$metricname] = $attrs; + $metric_names[$metricname] = 1; break; default: diff -Naur ganglia-3.0.1-orig/web/header.php ganglia-3.0.1/web/header.php --- ganglia-3.0.1-orig/web/header.php 2005-07-20 09:58:33.000000000 -0400 +++ ganglia-3.0.1/web/header.php 2005-07-20 11:23:14.000000000 -0400 @@ -219,13 +219,12 @@ if( $context == "cluster" ) { - if (!count($metrics)) { + if (!count($metric_names)) { 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) + foreach ($metric_names as $m => $foo) $context_metrics[] = $m; foreach ($reports as $r => $foo) $context_metrics[] = $r; ----- END PATCH ----- ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Ganglia-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ganglia-general ------------------------------------------------------------------------ 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. ------------------------------------------------------------------------

