mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Merge pull request #783 from OSSHelp/master
mysql_connections_per_user: fix for non-alphanumeric symbols in fields
This commit is contained in:
commit
66351303ef
1 changed files with 8 additions and 1 deletions
|
@ -100,6 +100,9 @@ sub print_graph_data() {
|
||||||
if($print_user eq "root") {
|
if($print_user eq "root") {
|
||||||
$print_user = "root_";
|
$print_user = "root_";
|
||||||
}
|
}
|
||||||
|
if ( $print_user =~ /[^A-Za-z0-9]/ ) {
|
||||||
|
$print_user =~ s/[^A-Za-z0-9]/_/;
|
||||||
|
}
|
||||||
print "$print_user.value $counts{$user}\n";
|
print "$print_user.value $counts{$user}\n";
|
||||||
}
|
}
|
||||||
my $other = $numthreads - $total;
|
my $other = $numthreads - $total;
|
||||||
|
@ -137,9 +140,13 @@ EOM
|
||||||
if($print_user eq "root") {
|
if($print_user eq "root") {
|
||||||
$print_user = "root_";
|
$print_user = "root_";
|
||||||
}
|
}
|
||||||
|
if ( $print_user =~ /[^A-Za-z0-9]/ ) {
|
||||||
|
$print_user =~ s/[^A-Za-z0-9]/_/;
|
||||||
|
}
|
||||||
|
|
||||||
print <<EOM;
|
print <<EOM;
|
||||||
$print_user.label $user
|
$print_user.label $user
|
||||||
$print_user.info Number of connexions used by user $print_user
|
$print_user.info Number of connexions used by user $user
|
||||||
EOM
|
EOM
|
||||||
print "$print_user.draw ";
|
print "$print_user.draw ";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue