diff options
| author | Petter Reinholdtsen <pere@hungry.com> | 2010-01-27 11:08:58 +0000 |
|---|---|---|
| committer | Petter Reinholdtsen <pere@hungry.com> | 2010-01-27 11:08:58 +0000 |
| commit | fb284a96d0b6334eff78d503d28422b00053d70e (patch) | |
| tree | 12bbddf1e926c3fb244eeac4f3319249c366e03e /munin-plugin-agesinceseen | |
| parent | be7419d972d8ba82e95f35d35e547b67468bc704 (diff) | |
| download | sitesummary-fb284a96d0b6334eff78d503d28422b00053d70e.tar.gz sitesummary-fb284a96d0b6334eff78d503d28422b00053d70e.tar.bz2 sitesummary-fb284a96d0b6334eff78d503d28422b00053d70e.tar.xz | |
Adjust site count munin plugin to use original site as label and
only remove illegal characters for the munin key.
Diffstat (limited to 'munin-plugin-agesinceseen')
| -rwxr-xr-x | munin-plugin-agesinceseen | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/munin-plugin-agesinceseen b/munin-plugin-agesinceseen index 86dfdf5..750ffba 100755 --- a/munin-plugin-agesinceseen +++ b/munin-plugin-agesinceseen @@ -23,7 +23,7 @@ my @order = map { $agegroups{$_}; } sort { $a <=> $b } keys %agegroups; sub label2key { my $label = shift; - $label =~ s/[ >]+/_/g; + $label =~ s/[^a-xA-Z_]+/_/g; $label =~ s/^_+//; return $label; } @@ -32,7 +32,7 @@ if (!$ARGV[0]) { for_all_hosts(\&handle_host); for my $label (@order) { - my $key = label2key($label); + my $key = label2key($label); print "$key.value ", defined $counts{$label} ? $counts{$label} : 0 , "\n"; } } elsif ($ARGV[0] eq "config") { @@ -46,14 +46,14 @@ if (!$ARGV[0]) { my $first = 1; for my $label (@order) { - my $key = label2key($label); + my $key = label2key($label); if ($first) { print "$key.draw AREA\n"; - $first = 0; + $first = 0; } else { print "$key.draw STACK\n"; } - print "$key.label $label\n"; + print "$key.label $label\n"; } } elsif ($ARGV[0] eq "autoconf") { # This module is only available when the sitesummary collector is |
