mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
mysql_connections_per_user: replace non-alphanumeric in field names plus print real username in label
This commit is contained in:
parent
71e8eb7ee5
commit
26ba6a3df5
1 changed files with 8 additions and 1 deletions
|
@ -100,6 +100,9 @@ sub print_graph_data() {
|
|||
if($print_user eq "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";
|
||||
}
|
||||
my $other = $numthreads - $total;
|
||||
|
@ -137,9 +140,13 @@ EOM
|
|||
if($print_user eq "root") {
|
||||
$print_user = "root_";
|
||||
}
|
||||
if ( $print_user =~ /[^A-Za-z0-9]/ ) {
|
||||
$print_user =~ s/[^A-Za-z0-9]/_/;
|
||||
}
|
||||
|
||||
print <<EOM;
|
||||
$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
|
||||
print "$print_user.draw ";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue