diff options
Diffstat (limited to 'munin-plugin-agesinceseen')
-rwxr-xr-x | munin-plugin-agesinceseen | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/munin-plugin-agesinceseen b/munin-plugin-agesinceseen index 9cd5f09..f052eb7 100755 --- a/munin-plugin-agesinceseen +++ b/munin-plugin-agesinceseen @@ -23,9 +23,12 @@ my @order = map { $agegroups{$_}; } sort { $a <=> $b } keys %agegroups; sub label2key { my $label = shift; - $label =~ s/[^a-zA-Z0-9_]+/_/g; - $label =~ s/^_+//; - return "_$label"; + # Clean using method described on + # http://munin-monitoring.org/wiki/notes_on_datasource_names + $label =~ s/^[^A-Za-z_]/_/; + $label =~ s/[^A-Za-z0-9_]/_/g; + + return "$label"; } if (!$ARGV[0]) { |