This commit is contained in:
Cyberes 2024-04-05 17:53:24 -06:00
parent 4b30649bbd
commit a2b6174b49
1 changed files with 4 additions and 4 deletions

View File

@ -55,8 +55,8 @@ def main(args):
'value': active_connections,
'min': 0,
'max': max_connections,
'warn': int(active_connections * warn_percent),
'crit': int(active_connections * crit_percent)
'warn': int(max_connections * warn_percent),
'crit': int(max_connections * crit_percent)
}
}
text_str = f'{active_connections}/{max_connections} ({active_connections_percent_str}%) of available connections used'
@ -66,8 +66,8 @@ def main(args):
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Check MySQL connections to a server.')
parser.add_argument('--host', required=True, help='The IP of the MySQL server to connect to.')
parser.add_argument('--username', required=True, help='Username.')
parser.add_argument('--password', required=True, help='Password.')
parser.add_argument('--username', required=True, help='Username to connect with.')
parser.add_argument('--password', required=True, help='Password to connect with.')
parser.add_argument('--warn-percent', default=50, type=int, help='Connections warning percentage. Default: 50%')
parser.add_argument('--crit-percent', default=75, type=int, help='Connections critical percentage. Default: 75%')
args = parser.parse_args()