diff --git a/plugins/mysql/mysql_connections_per_user b/plugins/mysql/mysql_connections_per_user index d0c8f98e..cc7bfbd0 100755 --- a/plugins/mysql/mysql_connections_per_user +++ b/plugins/mysql/mysql_connections_per_user @@ -75,11 +75,6 @@ if ($arg eq 'config') { sub print_graph_data() { # Define the values that are returned to munin - my ($current, $upper_limit) = (0,0,0); - - # Gather the values from mysqladmin - $current = poll_variables($MYSQL_VARIABLES,"Threads_connected"); - $upper_limit = poll_variables($MYSQL_VARIABLES,"max_connections"); # Return the values to Munin my $counts = count_thread_users(); @@ -89,12 +84,14 @@ sub print_graph_data() { return $counts{$a} <=> $counts{$b}; } my $i = 0; + my $total = 0; foreach my $user (sort valsort keys(%counts)) { last if $i++ >= $numusers; + $total += $counts{$user}; print "$user.value $counts{$user}\n"; } - print "current.value $current\n"; - print "limit.value $upper_limit\n"; + my $other = poll_variables($MYSQL_VARIABLES,"Threads_connected") - $total; + print "other.value $other\n"; } sub poll_variables { @@ -117,7 +114,7 @@ sub poll_variables { sub print_graph_information { print <= $numusers; print <