From d0990567d15cd8f5cfb03e375b77c947b98cac3f Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 3 Mar 2025 21:01:17 -0500 Subject: [PATCH] Better Dry Run Summary --- hwmonDaemon.py | 49 +++++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/hwmonDaemon.py b/hwmonDaemon.py index ef7da23..d6e16eb 100644 --- a/hwmonDaemon.py +++ b/hwmonDaemon.py @@ -114,25 +114,38 @@ class SystemHealthMonitor: } if self.dry_run: - logger.info("=== Detailed Health Check Results ===") - logger.info(f"Drive Health Status: {health_report['drives_health']['overall_status']}") - for drive in health_report['drives_health']['drives']: - temp_str = f", Temp: {drive.get('temperature')}°C" if drive.get('temperature') else "" - logger.info(f"Drive {drive['device']}{temp_str}: {drive.get('usage_percent', 0)}% used, SMART: {drive['smart_status']}") - for partition in drive.get('partitions', []): - logger.info(f" └─ {partition['device']} mounted on {partition['mountpoint']}") - logger.info(f" {partition['used_space']}/{partition['total_space']} ({partition['usage_percent']}% used)") - - logger.info(f"Memory Status: {health_report['memory_health']['status']}") - logger.info(f"Memory Usage: {health_report['memory_health']['memory_percent']}%") - logger.info(f"ECC Memory: {'Present' if health_report['memory_health']['has_ecc'] else 'Not Present'}") - if health_report['memory_health']['has_ecc'] and health_report['memory_health']['ecc_errors']: - logger.info(f"ECC Errors: {health_report['memory_health']['ecc_errors']}") + logger.info("\n=== System Health Summary ===") + logger.info(f"Overall Drive Health: {health_report['drives_health']['overall_status']}") - logger.info(f"CPU Usage: {health_report['cpu_health']['cpu_usage_percent']}% ({health_report['cpu_health']['status']})") - logger.info(f"Network Management Status: {health_report['network_health']['management_network']['status']}") - logger.info(f"Network Ceph Status: {health_report['network_health']['ceph_network']['status']}") - logger.info("================================") + # Summarized drive information with usage + logger.info("\nDrive Status:") + for drive in health_report['drives_health']['drives']: + issues = drive.get('smart_issues', []) + temp = f", {drive.get('temperature')}°C" if drive.get('temperature') else "" + status = "⚠️ " if issues else "✓ " + + # Disk usage information + usage_info = "" + if drive.get('partitions'): + for partition in drive['partitions']: + usage_info += f"\n └─ {partition['mountpoint']}: {partition['used_space']}/{partition['total_space']} ({partition['usage_percent']}% used)" + + logger.info(f"{status}{drive['device']}{temp} - SMART: {drive['smart_status']}{usage_info}") + if issues: + logger.info(f" Issues: {', '.join(issues)}") + + logger.info(f"\nMemory: {health_report['memory_health']['memory_percent']}% used") + if health_report['memory_health'].get('has_ecc'): + logger.info("ECC Memory: Present") + if health_report['memory_health'].get('ecc_errors'): + logger.info(f"ECC Errors: {len(health_report['memory_health']['ecc_errors'])} found") + + logger.info(f"\nCPU Usage: {health_report['cpu_health']['cpu_usage_percent']}%") + + logger.info("\nNetwork Status:") + logger.info(f"Management: {health_report['network_health']['management_network']['status']}") + logger.info(f"Ceph: {health_report['network_health']['ceph_network']['status']}") + logger.info("\n=== End Summary ===") return health_report