aboutsummaryrefslogtreecommitdiffstats
path: root/munin-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'munin-plugin')
-rwxr-xr-xmunin-plugin10
1 files changed, 6 insertions, 4 deletions
diff --git a/munin-plugin b/munin-plugin
index 8c18a87..ecd8764 100755
--- a/munin-plugin
+++ b/munin-plugin
@@ -50,10 +50,12 @@ if (!$ARGV[0]) {
sub label2key {
my $label = shift;
- # Removing illegal characters. Apparently using '_' as a
- # replacement character break graph generation with version 1.2.5.
- $label =~ s/[^a-zA-Z0-9]+//g;
- 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";
}
sub handle_host {