diff --git a/miscellaneous/dbcheck1.py b/miscellaneous/dbcheck1.py index ee49efe..a376290 100644 --- a/miscellaneous/dbcheck1.py +++ b/miscellaneous/dbcheck1.py @@ -23,7 +23,7 @@ NODES = [ {"name": "db2", "host": "cluster.db2.genesishostingtechnologies.com", "ssh_user": "doc", "services": ["postgresql@16-main.service"], "disks": ["/", "/var/lib/postgresql"], "type": "remote", "db": True, "raid": False} ] -# ==== Mastodon DM function with retry ==== +# ==== Mastodon DM with retry ==== def mastodon_dm(message, retries=3): url = f"{MASTODON_INSTANCE}/api/v1/statuses" headers = {"Authorization": f"Bearer {MASTODON_TOKEN}"} @@ -59,7 +59,7 @@ def choose_emoji(line): return "💥" return "⚠️" -# ==== Check rclone health ==== +# ==== Health checks ==== def check_rclone_health(node): try: result = ssh_command(node["host"], node["ssh_user"], "rclone rc vfs/stats") @@ -73,7 +73,6 @@ def check_rclone_health(node): return ("critical", f"[{node['name']}] ERROR: Could not check rclone health: {str(e)}") return None -# ==== Remote log scan ==== def check_remote_logs(host, user, node_name): alerts = [] for log in LOG_FILES: @@ -89,7 +88,7 @@ def check_remote_logs(host, user, node_name): alerts.append(f"[{node_name}] ERROR: Could not read log {log}: {e}") return alerts -# ==== Main Routine ==== +# ==== Main routine ==== def main(): critical_problems = [] warning_problems = [] @@ -178,8 +177,7 @@ def main(): f.write("
Last Checked: {now}
") - f.write("System | Status |
---|
System | Status |
---|---|
{node} | {status} |