xerxes-nano-poe-network-check.sh
Bash script to diagnose the PoE-compatible Gigabit Ethernet interface of the Xerxes Nano, crucial for 1U rack deployments.
Hardware: Xerxes Nano connected to a PoE switch via RJ45. The power jumper must be set to PoE. Execution: chmod +x net_check.sh && ./net_check.sh. Check that the RJ45 port LED is lit. This script uses sysfs to read physical status without external dependencies.
xerxes-nano-poe-network-check.sh
#!/bin/bash
# Script de vérification réseau pour Xerxes Nano (Port RJ45 PoE)
INTERFACE="eth0" # Ajuster selon l'interface (eth0, enp1s0, etc.)
if [ -d "/sys/class/net/$INTERFACE" ]; then
LINK_STATUS=$(cat /sys/class/net/$INTERFACE/operstate)
SPEED=$(cat /sys/class/net/$INTERFACE/speed 2>/dev/null || echo "N/A")
MAC=$(cat /sys/class/net/$INTERFACE/address)
echo "Interface: $INTERFACE"
echo "MAC: $MAC"
echo "État du lien: $LINK_STATUS"
echo "Vitesse: $SPEED Mb/s"
if [ "$LINK_STATUS" == "up" ]; then
echo "[OK] Connexion PoE active et opérationnelle."
else
echo "[ERREUR] Lien inactif. Vérifiez le câble et l'alimentation PoE."
fi
else
echo "Interface $INTERFACE non trouvée."
fi