Better Dry Run Summary

This commit is contained in:
2025-03-03 21:01:17 -05:00
parent 30f1ae38c7
commit d0990567d1

View File

@ -114,25 +114,38 @@ class SystemHealthMonitor:
} }
if self.dry_run: if self.dry_run:
logger.info("=== Detailed Health Check Results ===") logger.info("\n=== System Health Summary ===")
logger.info(f"Drive Health Status: {health_report['drives_health']['overall_status']}") logger.info(f"Overall Drive Health: {health_report['drives_health']['overall_status']}")
# Summarized drive information with usage
logger.info("\nDrive Status:")
for drive in health_report['drives_health']['drives']: for drive in health_report['drives_health']['drives']:
temp_str = f", Temp: {drive.get('temperature')}°C" if drive.get('temperature') else "" issues = drive.get('smart_issues', [])
logger.info(f"Drive {drive['device']}{temp_str}: {drive.get('usage_percent', 0)}% used, SMART: {drive['smart_status']}") temp = f", {drive.get('temperature')}°C" if drive.get('temperature') else ""
for partition in drive.get('partitions', []): status = "⚠️ " if issues else ""
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']}") # Disk usage information
logger.info(f"Memory Usage: {health_report['memory_health']['memory_percent']}%") usage_info = ""
logger.info(f"ECC Memory: {'Present' if health_report['memory_health']['has_ecc'] else 'Not Present'}") if drive.get('partitions'):
if health_report['memory_health']['has_ecc'] and health_report['memory_health']['ecc_errors']: for partition in drive['partitions']:
logger.info(f"ECC Errors: {health_report['memory_health']['ecc_errors']}") usage_info += f"\n └─ {partition['mountpoint']}: {partition['used_space']}/{partition['total_space']} ({partition['usage_percent']}% used)"
logger.info(f"CPU Usage: {health_report['cpu_health']['cpu_usage_percent']}% ({health_report['cpu_health']['status']})") logger.info(f"{status}{drive['device']}{temp} - SMART: {drive['smart_status']}{usage_info}")
logger.info(f"Network Management Status: {health_report['network_health']['management_network']['status']}") if issues:
logger.info(f"Network Ceph Status: {health_report['network_health']['ceph_network']['status']}") logger.info(f" Issues: {', '.join(issues)}")
logger.info("================================")
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 return health_report