diff --git a/plugins/other/http-response-times b/plugins/other/http-response-times index 5196bf3a..6c7ecab0 100755 --- a/plugins/other/http-response-times +++ b/plugins/other/http-response-times @@ -60,7 +60,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "config") { foreach my $url (@urls) { my $label = $url; #fix up our label name to be a valid variable name - $label =~ s@[\/-]@_@g; + $label =~ s@[^A-Za-z0-9_]@_@g; print "$label.label $url\n"; print "$label.type GAUGE\n"; } @@ -78,9 +78,9 @@ sub req_time { my $outdir = '/tmp/munin/' . int(rand(32000)); system("mkdir -p $outdir"); if ($ENV{'action'} eq "full") { - $time = `/usr/bin/time -f "%e" wget -pq -P $outdir --header "Accept-Encoding: gzip,deflate" $url 2>&1`; + $time = `/usr/bin/time -f "%e" wget -pq -P $outdir --header "Accept-Encoding: gzip,deflate" "$url" 2>&1`; } elsif ($ENV{'action'} eq "index") { - $time = `/usr/bin/time -f "%e" wget -q -P $outdir --header "Accept-Encoding: gzip,deflate" $url 2>&1`; + $time = `/usr/bin/time -f "%e" wget -q -P $outdir --header "Accept-Encoding: gzip,deflate" "$url" 2>&1`; } system("rm -rf $outdir"); return $time; @@ -90,7 +90,7 @@ sub req_time { foreach my $url (@urls) { my $label = $url; #fix up our label name to be a valid name - $label =~ s@[\/-]@_@g; + $label =~ s@[^A-Za-z0-9_]@_@g; print "$label.value " . req_time($domain.$url); }