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:
logger.info("=== Detailed Health Check Results ===")
logger.info(f"Drive Health Status: {health_report['drives_health']['overall_status']}")
logger.info("\n=== System Health Summary ===")
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']:
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)")
issues = drive.get('smart_issues', [])
temp = f", {drive.get('temperature')}°C" if drive.get('temperature') else ""
status = "⚠️ " if issues else ""
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']}")
# 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"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("================================")
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