Switch from the "1 minute" to "15 minutes" average.

This commit is contained in:
Ivaylo Novakov 2020-08-28 11:59:27 +02:00
parent efb35054f7
commit 58409b8cee
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
1 changed files with 2 additions and 2 deletions

View File

@ -55,9 +55,9 @@ async def check_load_average():
uptime_string = os.popen("uptime").read().strip()
# pattern = ""
if sys.platform == "Darwin":
pattern = "^.*load averages: (\d*\.\d*) \d*\.\d* \d*\.\d*$"
pattern = "^.*load averages: \d*\.\d* \d*\.\d* (\d*\.\d*)$"
else:
pattern = "^.*load average: (\d*\.\d*), \d*\.\d*, \d*\.\d*$"
pattern = "^.*load average: \d*\.\d*, \d*\.\d*, (\d*\.\d*)$"
load_av = re.match(pattern, uptime_string).group(1)
if float(load_av) > 10:
await send_msg(client, "High system load detected: `{}`".format(uptime_string), force_notify=True)