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 <jerome.oufella@savoirfairelinux.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
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);