Skip to content

Commit

Permalink
mysql-connections: Add perfdata mysql_max_used_connections
Browse files Browse the repository at this point in the history
  • Loading branch information
markuslf committed Oct 26, 2023
1 parent 3c17232 commit 5daaca5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Monitoring Plugins:
* journald-query: Improve output
* mysql-aria: Remove WARN if `aria_pagecache_read_requests` > 0 and `pct_aria_keys_from_mem` < 95%
* mysql-connections: Report and warn on current usage instead of peak usage, and improved output.
* mysql-connections: Add perfdata mysql_max_used_connections
* mysql-innodb-buffer-pool-size: Improve code and output
* mysql-logfile: Stop magic auto-configure if `--server-log` is given
* mysql-logfile: Returns OK instead of UNKNOWN if logfile is found but empty
Expand Down
1 change: 1 addition & 0 deletions check-plugins/mysql-connections/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Perfdata / Metrics
mysql_connections, Continous Counter, "Value of the MySQL ``Connections`` status variable. Number of all connection attempts (both successful and unsuccessful)."
mysql_interactive_timeout, Seconds, "Value of the MySQL ``interactive_timeout`` system variable. Time in seconds that the server waits for an interactive connection (one that connects with the mysql_real_connect() CLIENT_INTERACTIVE option) to become active before closing it."
mysql_max_connections, Number, "Value of the MySQL ``max_connections`` system variable. The maximum number of simultaneous client connections."
mysql_max_used_connections, Number, ""Value of the MySQL ``Max_used_connections`` status variable. Max number of connections ever open at the same time."
mysql_pct_connections_aborted, Percentage, Aborted_connects / Connections \* 100
mysql_pct_connections_used, Percentage, Threads_connected / max_connections \* 100
mysql_threads_connected, None, "Value of the MySQL ``Threads_connected`` status variable. Number of clients connected to the server. Is inaccurate when the thread pool is in use, since each client connection does not correspond to a dedicated thread in that case."
Expand Down
3 changes: 2 additions & 1 deletion check-plugins/mysql-connections/mysql-connections
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ from lib.globals import (STATE_OK, STATE_UNKNOWN, # pylint: disable=C0413
STATE_WARN)

__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
__version__ = '2023100902'
__version__ = '2023102601'

DESCRIPTION = """Checks the connection usage rate, the rate of aborted connections and
if name resolution is active for new connections on MySQL/MariaDB."""
Expand Down Expand Up @@ -217,6 +217,7 @@ def main():

perfdata += lib.base.get_perfdata('mysql_aborted_connects', mystat['Aborted_connects'], 'c', None, None, 0, None)
perfdata += lib.base.get_perfdata('mysql_connections', mystat['Connections'], 'c', None, None, 0, None)
perfdata += lib.base.get_perfdata('mysql_max_used_connections', mystat['Max_used_connections'], None, None, None, 0, None)
perfdata += lib.base.get_perfdata('mysql_threads_connected', mystat['Threads_connected'], None, None, None, 0, None)
perfdata += lib.base.get_perfdata('mysql_threads_running', mystat['Threads_running'], None, None, None, 0, None)

Expand Down

0 comments on commit 5daaca5

Please sign in to comment.