mirror of
https://git.elrant.team/irisnk/IHNMAYIML.git
synced 2024-12-04 06:26:29 +03:00
She type on my safety till i stop concatenating on her string
This commit is contained in:
parent
f482845365
commit
5c2f8c9299
4 changed files with 8 additions and 4 deletions
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -7,5 +7,6 @@
|
|||
"**/.DS_Store": true,
|
||||
"**/Thumbs.db": true
|
||||
},
|
||||
"hide-files.files": []
|
||||
"hide-files.files": [],
|
||||
"python.analysis.typeCheckingMode": "basic"
|
||||
}
|
|
@ -7,4 +7,5 @@ def check_boot_errors():
|
|||
result = subprocess.run(["dmesg"], capture_output=True, text=True)
|
||||
errors = result.stdout.lower().count("error")
|
||||
if errors > 30:
|
||||
log_message("Last boot has had more than 30 errors,, :c (according to dmesg)" + environ.get("BOT_OWNER") + " please check the logs!")
|
||||
bot_owner = environ.get("BOT_OWNER", "Unknown")
|
||||
log_message(f"Last boot has had more than 30 errors,, :c (according to dmesg) {bot_owner} please check the logs!")
|
||||
|
|
|
@ -14,7 +14,8 @@ def check_cpu_usage():
|
|||
cpu_overload_start = datetime.now()
|
||||
elif (datetime.now() - cpu_overload_start).total_seconds() > 120:
|
||||
process_info = get_top_cpu_process()
|
||||
log_message(f"CPU overloaded by {process_info} for more than 2 minutes,," + environ.get("BOT_OWNER") + " please do something!")
|
||||
bot_owner = environ.get("BOT_OWNER", "Unknown")
|
||||
log_message(f"CPU overloaded by {process_info} for more than 2 minutes,, {bot_owner} please do something!")
|
||||
cpu_overload_start = None # Reset
|
||||
else:
|
||||
cpu_overload_start = None # Reset if not overloaded
|
||||
|
|
|
@ -25,7 +25,8 @@ def main():
|
|||
post_to_misskey("Performed system health check.")
|
||||
time.sleep(300) # Wait for 5 minutes before next check
|
||||
except KeyboardInterrupt:
|
||||
log_message("Monitoring stopped by " + environ.get("BOT_OWNER") + " ,,")
|
||||
bot_owner = environ.get("BOT_OWNER", "Unknown")
|
||||
log_message(f"Monitoring stopped by {bot_owner} ,,")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Reference in a new issue