It's my understanding that if I have the following in conf.php:

    $conf['optional_cluster_graphs_for_host_view'] = false;

and I have no host-level optional graphs (i.e. all set to 'ignored')
and I enable an optional graph at the cluster level then I should not
see the graph at the host level. Unfortunately, that's not the case;
I do see it.

Poking around in the code it looks like getOptionalReports() in
host_view.php is (subject to some conditions) including the
cluster_<cluster-name>.json file twice, first time only if
$conf['optional_cluster_graphs_for_host_view'] is true and the
second time if a host_<hostname>.json file does not exist.

It could well be that my understanding is wrong or I have not
considered some combination of circumstances, but if all that
is okay then here's a patch (which also removes an nearby near
duplicate definition of $cluster_file):

--- host_view.php.orig  2015-09-30 15:26:59.259677153 +0200
+++ host_view.php       2015-09-30 16:02:23.534041873 +0200
@@ -92,9 +92,8 @@
     $override_reports = array_merge(
       $override_reports,
       json_decode(file_get_contents($host_file), TRUE));
-  } else {
+  } elseif ($conf['optional_cluster_graphs_for_host_view']) {
     // If there is no host file, look for a default cluster file
-    $cluster_file = $conf['conf_dir'] . "/cluster_" . $clustername . ".json";
     if ( is_file($cluster_file) ) {
       $override_reports = array_merge(
         $override_reports,

(That's a patch against the version on github, which is the same
as my system.)

HTH

Alexis

<<attachment: alexis_huxley.vcf>>

------------------------------------------------------------------------------
_______________________________________________
Ganglia-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-general

Reply via email to