From 29dd82be36b686901c7240b0634afa5b2e570ec1 Mon Sep 17 00:00:00 2001 From: Vincas Dargis Date: Wed, 28 Mar 2018 11:43:28 +0000 Subject: [PATCH] Fix du-2 to use clean_fieldname() Update du-2 to fix "No .label provided" error by using clean_fieldname(). --- plugins/disk/du-2 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/disk/du-2 b/plugins/disk/du-2 index 41e4adc1..6b8dfddc 100755 --- a/plugins/disk/du-2 +++ b/plugins/disk/du-2 @@ -91,12 +91,12 @@ if( (defined $ARGV[0]) && ($ARGV[0] eq "config") ) { while(defined (my $bar = )) { if ($bar =~ m/(\d+)\s+(.+)/) { my $dir = $2; - clean_path(\$dir); - print "$dir.label $dir\n"; + my $clean_dir = clean_fieldname($dir); + print "$clean_dir.label $dir\n"; if ($foo++) { - print "$dir.draw STACK\n"; + print "$clean_dir.draw STACK\n"; } else { - print "$dir.draw AREA\n"; + print "$clean_dir.draw AREA\n"; } } } @@ -110,8 +110,7 @@ open (FILE, "<", $CACHEFILE) or munin_exit_fail(); while(defined (my $foo = )) { if ($foo =~ m/(\d+)\s+(.+)/) { my ($field, $value) = ($2, $1); - clean_path(\$field); - print $field, ".value ", $value, "\n"; + print clean_fieldname($field), ".value ", $value, "\n"; } } close(FILE);