if ! command -v dmidecode &> /dev/null; then echo "dmidecode is not installed on this node." >> "$OUTPUT_FILE" echo "Unable to retrieve memory serial numbers." >> "$OUTPUT_FILE" exit 1 fi
# Check for ECC errors using dmidecode
echo "Checking for ECC errors..."
# Get the memory details
MEMORY_INFO=$(dmidecode --type memory)
# Check for ECC errors
if echo "$MEMORY_INFO" | grep -q "Error Correction Type: Multi-bit ECC"; then echo "ECC Errors detected!" >> "$OUTPUT_FILE"