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.
<Type fanspeed>
DataSources value
DSName value RPM
<Type fanspeed>
DataSources value
DSName value RPM
- RRDTitle "Fanspeed ({type_instance})"
+ RRDTitle "Fanspeed ({instance})"
RRDVerticalLabel "RPM"
RRDFormat "%6.1lf"
Color value 00b000
RRDVerticalLabel "RPM"
RRDFormat "%6.1lf"
Color value 00b000
<Type temperature>
DataSources value
DSName value Temp
<Type temperature>
DataSources value
DSName value Temp
- RRDTitle "Temperature ({type_instance})"
+ RRDTitle "Temperature ({instance})"
RRDVerticalLabel "°Celsius"
RRDFormat "%4.1lf°C"
</Type>
RRDVerticalLabel "°Celsius"
RRDFormat "%4.1lf°C"
</Type>
my $plugin_instance = $ident->{'plugin_instance'};
my $type = $ident->{'type'};
my $type_instance = $ident->{'type_instance'};
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)
{
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#{plugin_instance}#$plugin_instance#g;
$title =~ s#{type}#$type#g;
$title =~ s#{type_instance}#$type_instance#g;
+ $title =~ s#{instance}#$instance#g;