diff options
-rw-r--r-- | debian/changelog | 5 | ||||
-rwxr-xr-x | munin-plugin | 10 | ||||
-rwxr-xr-x | munin-plugin-agesinceseen | 9 |
3 files changed, 14 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog index 2acacea..e9a1dd2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,9 +7,8 @@ sitesummary (0.1.3) UNRELEASED; urgency=low this time. Check for dhcpd3 on Lenny and dhcpd on Squeeze++. * Make sure to restart nagios-nrpe-server when sitesummary-client is upgraded, to tell it to discover any new NRPE rules. - * Correct generated label names used by Munin plugin - munin-plugin-agesinceseen, and start with _ to make sure the first - character is never a digit. + * Correct how to generate label names used by Munin plugins using + the translation rule proposed by the Munin project. -- Petter Reinholdtsen <pere@debian.org> Mon, 13 Feb 2012 11:04:46 +0100 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 { 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]) { |