X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=contrib%2Fcollection3%2Flib%2FCollectd%2FGraph%2FType.pm;h=1fb60afeecdd31a36b2eb4f1faefcaaad08ba149;hb=98d439dab9c3d321f0115e07b826bfe7bbbcca80;hp=60097e5c43653c8e2cd3aedabceb8bc877236dfe;hpb=4e51eefd95e80f90eae602958713c9c630659ce7;p=collectd.git diff --git a/contrib/collection3/lib/Collectd/Graph/Type.pm b/contrib/collection3/lib/Collectd/Graph/Type.pm index 60097e5c..1fb60afe 100644 --- a/contrib/collection3/lib/Collectd/Graph/Type.pm +++ b/contrib/collection3/lib/Collectd/Graph/Type.pm @@ -248,6 +248,20 @@ sub getTitle my $plugin_instance = $ident->{'plugin_instance'}; my $type = $ident->{'type'}; my $type_instance = $ident->{'type_instance'}; + my $instance; + + if (defined $type_instance) + { + $instance = $type_instance; + } + elsif (defined $plugin_instance) + { + $instance = $plugin_instance; + } + else + { + $instance = 'no instance'; + } if (!defined $plugin_instance) { @@ -264,6 +278,7 @@ sub getTitle $title =~ s#{plugin_instance}#$plugin_instance#g; $title =~ s#{type}#$type#g; $title =~ s#{type_instance}#$type_instance#g; + $title =~ s#{instance}#$instance#g; return ($title); }