mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
newznab/nn_: use label instead of all-numeric name
This way clean_fieldname works, since an clean_fieldname reduces all-numeric input to a single underscore. This change has not been tested, so testing and feedback (especially pull requests) are welcome. Reference: https://github.com/munin-monitoring/contrib/pull/113
This commit is contained in:
parent
ccaeefff42
commit
5fbf46aa9a
@ -232,10 +232,10 @@ sub config {
|
||||
|
||||
if ($k eq 'draw' && $v eq 'AREASTACK') {
|
||||
printf("%s.%s %s\n",
|
||||
clean_fieldname($ds->{name}), $k, ($i ? 'STACK' : 'AREA'));
|
||||
clean_fieldname($ds->{label}), $k, ($i ? 'STACK' : 'AREA'));
|
||||
}
|
||||
else {
|
||||
printf("%s.%s %s\n", clean_fieldname($ds->{name}), $k, $v);
|
||||
printf("%s.%s %s\n", clean_fieldname($ds->{label}), $k, $v);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@ -265,7 +265,7 @@ sub show {
|
||||
my $graph = $graphs{$graph_name};
|
||||
run_queries($graph_name);
|
||||
for my $ds (@{$graph->{data_sources}}) {
|
||||
printf "%s.value %s\n", clean_fieldname($ds->{name}), ($data->{$ds->{name}} ? $data->{$ds->{name}} : '0');
|
||||
printf "%s.value %s\n", clean_fieldname($ds->{label}), ($data->{$ds->{name}} ? $data->{$ds->{name}} : '0');
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user