From 5fbf46aa9adff3f1d68513fbbb9eaa44873744a5 Mon Sep 17 00:00:00 2001 From: Kenyon Ralph Date: Thu, 7 Mar 2013 23:27:06 -0800 Subject: [PATCH] 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 --- plugins/newznab/nn_ | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/newznab/nn_ b/plugins/newznab/nn_ index ad591a0d..79de3394 100644 --- a/plugins/newznab/nn_ +++ b/plugins/newznab/nn_ @@ -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; }