When selecting multiple hosts in collection3's hosts list, and with some plugins only (the ones that use a specific resource name such as memory or tcpconns), the resulting graph list will be limited to one single graph (instead of one per host).
This patch addresses this issue by modifying the name of the hash key in the group_files_by_plugin_instance function, making it less prone to name collisions by prefixing it by the host name. Comments and enhancements will be welcome. Signed-off-by: Jerome Oufella <[email protected]> --- contrib/collection3/lib/Collectd/Graph/Common.pm | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/contrib/collection3/lib/Collectd/Graph/Common.pm b/contrib/collection3/lib/Collectd/Graph/Common.pm index f88c22b..c6e2508 100644 --- a/contrib/collection3/lib/Collectd/Graph/Common.pm +++ b/contrib/collection3/lib/Collectd/Graph/Common.pm @@ -106,7 +106,9 @@ sub group_files_by_plugin_instance for (my $i = 0; $i < @files; $i++) { my $file = $files[$i]; - my $key = $file->{'plugin_instance'} || ''; + my $key1 = $file->{'hostname'} || ''; + my $key2 = $file->{'plugin_instance'} || ''; + my $key = "$key1-$key2"; $data->{$key} ||= []; push (@{$data->{$key}}, $file); -- 1.7.0.4 _______________________________________________ collectd mailing list [email protected] http://mailman.verplant.org/listinfo/collectd
