summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7f5e34)
raw | patch | inline | side by side (parent: d7f5e34)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 27 Jul 2008 15:22:26 +0000 (17:22 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 27 Jul 2008 15:22:26 +0000 (17:22 +0200) |
It will be replaced by either the type or plugin instance, depending on
which is defined.. This is handy for temperatures and stuff like that,
where sometimes the type instance doesn't exist.
which is defined.. This is handy for temperatures and stuff like that,
where sometimes the type instance doesn't exist.
contrib/collection3/etc/collection.conf | patch | blob | history | |
contrib/collection3/lib/Collectd/Graph/Type.pm | patch | blob | history |
index a8be4fda11d03b97c1783b9154c3db2098e8363a..e60316fecc4b1a09cabb03ab0addfb1529c76fe1 100644 (file)
<Type fanspeed>
DataSources value
DSName value RPM
- RRDTitle "Fanspeed ({type_instance})"
+ RRDTitle "Fanspeed ({instance})"
RRDVerticalLabel "RPM"
RRDFormat "%6.1lf"
Color value 00b000
<Type temperature>
DataSources value
DSName value Temp
- RRDTitle "Temperature ({type_instance})"
+ RRDTitle "Temperature ({instance})"
RRDVerticalLabel "°Celsius"
RRDFormat "%4.1lf°C"
</Type>
diff --git a/contrib/collection3/lib/Collectd/Graph/Type.pm b/contrib/collection3/lib/Collectd/Graph/Type.pm
index 60097e5c43653c8e2cd3aedabceb8bc877236dfe..1fb60afeecdd31a36b2eb4f1faefcaaad08ba149 100644 (file)
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)
{
$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);
}