From 86d9a8ca895d70631b33487f6a9a7cfb8f5bdece Mon Sep 17 00:00:00 2001 From: Pau Capdevila Date: Tue, 11 Feb 2025 16:05:34 +0100 Subject: [PATCH 1/4] Extend show-tech scripts and increase timeout Signed-off-by: Pau Capdevila --- pkg/hhfab/show-tech/control.sh | 181 +++++++++++++++++------------- pkg/hhfab/show-tech/server.sh | 198 +++++++++++++++++++++++---------- pkg/hhfab/show-tech/switch.sh | 125 +++++++++++++++++---- pkg/hhfab/vlabhelpers.go | 2 +- 4 files changed, 345 insertions(+), 161 deletions(-) diff --git a/pkg/hhfab/show-tech/control.sh b/pkg/hhfab/show-tech/control.sh index 788b88bcf..3e331dfc2 100644 --- a/pkg/hhfab/show-tech/control.sh +++ b/pkg/hhfab/show-tech/control.sh @@ -3,88 +3,113 @@ # SPDX-License-Identifier: Apache-2.0 # show-tech.sh: Collect diagnostics from a Control node. +set +e -# Set the output file OUTPUT_FILE="/tmp/show-tech.log" - -# Clear the log file -: > "$OUTPUT_FILE" - -# Set the kubectl path KUBECTL="/opt/bin/kubectl" -echo "=== System Information ===" >> "$OUTPUT_FILE" -uname -a >> "$OUTPUT_FILE" -cat /etc/os-release >> "$OUTPUT_FILE" - -echo -e "\n=== Network Configuration ===" >> "$OUTPUT_FILE" -ip addr show >> "$OUTPUT_FILE" -ip route show >> "$OUTPUT_FILE" - -echo -e "\n=== K3s Version ===" >> "$OUTPUT_FILE" -k3s --version >> "$OUTPUT_FILE" 2>/dev/null - -echo -e "\n=== Kubernetes Nodes ===" >> "$OUTPUT_FILE" -$KUBECTL get nodes -o wide >> "$OUTPUT_FILE" 2>/dev/null - -echo -e "\n=== Kubernetes Pods ===" >> "$OUTPUT_FILE" -$KUBECTL get pods -A -o wide >> "$OUTPUT_FILE" 2>/dev/null - -echo -e "\n=== Kubernetes Events ===" >> "$OUTPUT_FILE" -$KUBECTL get events -A >> "$OUTPUT_FILE" 2>/dev/null - -echo -e "\n=== Describe All Kubernetes Pods ===" >> "$OUTPUT_FILE" -for ns in $($KUBECTL get ns -o jsonpath='{.items[*].metadata.name}'); do - for pod in $($KUBECTL get pods -n $ns -o jsonpath='{.items[*].metadata.name}'); do - echo -e "\n--- Namespace: $ns, Pod: $pod ---" >> "$OUTPUT_FILE" - $KUBECTL describe pod "$pod" -n "$ns" >> "$OUTPUT_FILE" 2>/dev/null - - echo -e "\nLogs for Pod: $pod in Namespace: $ns" >> "$OUTPUT_FILE" - $KUBECTL logs "$pod" -n "$ns" --all-containers=true >> "$OUTPUT_FILE" 2>/dev/null - - echo -e "\nPrevious Logs for Pod: $pod in Namespace: $ns (if available)" >> "$OUTPUT_FILE" - $KUBECTL logs "$pod" -n "$ns" --all-containers=true --previous >> "$OUTPUT_FILE" 2>/dev/null - done -done - -echo -e "\n=== Disk Usage ===" >> "$OUTPUT_FILE" -df -h >> "$OUTPUT_FILE" - -echo -e "\n=== Running Processes ===" >> "$OUTPUT_FILE" -ps aux >> "$OUTPUT_FILE" - -# Get custom resources - -echo -e "\n=== Githedgehog.com Resources ===" >> "$OUTPUT_FILE" - -crds_githedgehog=$($KUBECTL get crds -o custom-columns=":metadata.name" | grep 'githedgehog.com') - -for crd in $crds_githedgehog; do - echo -e "\n=== Instances of $crd ===" >> "$OUTPUT_FILE" - $KUBECTL get $crd -A >> "$OUTPUT_FILE" 2>/dev/null -done - -resources_githedgehog=$($KUBECTL api-resources --verbs=list --namespaced=true -o name | grep 'githedgehog.com') - -for resource in $resources_githedgehog; do - echo -e "\n=== Instances of $resource ===" >> "$OUTPUT_FILE" - $KUBECTL get $resource -A >> "$OUTPUT_FILE" 2>/dev/null -done - -resources_non_namespaced_githedgehog=$($KUBECTL api-resources --verbs=list --namespaced=false -o name | grep 'githedgehog.com') - -for resource in $resources_non_namespaced_githedgehog; do - echo -e "\n=== Instances of $resource (non-namespaced) ===" >> "$OUTPUT_FILE" - $KUBECTL get $resource >> "$OUTPUT_FILE" 2>/dev/null -done - -echo -e "\n=== systemd-networkd logs ===" >> "$OUTPUT_FILE" -journalctl -u systemd-networkd >> "$OUTPUT_FILE" 2>/dev/null - -echo -e "\n=== kernel logs ===" >> "$OUTPUT_FILE" -journalctl -k >> "$OUTPUT_FILE" 2>/dev/null +: > "$OUTPUT_FILE" -echo -e "\n=== Kernel Network Logs ===" >> "$OUTPUT_FILE" -dmesg | grep -i "network\|bond\|vlan" >> "$OUTPUT_FILE" +# --------------------------- +# Basic System Information +# --------------------------- +{ + echo "=== System Information ===" + uname -a + cat /etc/os-release + + echo -e "\n=== K3s Version ===" + k3s --version +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Network Configuration +# --------------------------- +{ + echo -e "\n=== Network Configuration ===" + ip addr show + ip route show + + echo -e "\n=== Disk Usage ===" + df -h + + echo -e "\n=== Running Processes ===" + ps aux +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Kubernetes Cluster Status +# --------------------------- +{ + echo -e "\n=== Kubernetes Nodes ===" + $KUBECTL get nodes -o wide + + echo -e "\n=== Kubernetes Pods ===" + $KUBECTL get pods -A -o wide + + echo -e "\n=== Kubernetes Events ===" + $KUBECTL get events -A +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Detailed Pod Information +# --------------------------- +{ + echo -e "\n=== Describe All Kubernetes Pods ===" + for ns in $($KUBECTL get ns -o jsonpath='{.items[*].metadata.name}'); do + for pod in $($KUBECTL get pods -n $ns -o jsonpath='{.items[*].metadata.name}'); do + echo -e "\n--- Namespace: $ns, Pod: $pod ---" + $KUBECTL describe pod "$pod" -n "$ns" + + echo -e "\nLogs for Pod: $pod in Namespace: $ns" + $KUBECTL logs "$pod" -n "$ns" --all-containers=true + + echo -e "\nPrevious Logs for Pod: $pod in Namespace: $ns (if available)" + $KUBECTL logs "$pod" -n "$ns" --all-containers=true --previous + done + done +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Githedgehog Resources +# --------------------------- +{ + echo -e "\n=== Githedgehog.com Resources ===" + + # Custom Resource Definitions + crds_githedgehog=$($KUBECTL get crds -o custom-columns=":metadata.name" | grep 'githedgehog.com') + for crd in $crds_githedgehog; do + echo -e "\n=== Instances of $crd ===" + $KUBECTL get $crd -A + done + + # Namespaced Resources + resources_githedgehog=$($KUBECTL api-resources --verbs=list --namespaced=true -o name | grep 'githedgehog.com') + for resource in $resources_githedgehog; do + echo -e "\n=== Instances of $resource ===" + $KUBECTL get $resource -A + done + + # Non-namespaced Resources + resources_non_namespaced_githedgehog=$($KUBECTL api-resources --verbs=list --namespaced=false -o name | grep 'githedgehog.com') + for resource in $resources_non_namespaced_githedgehog; do + echo -e "\n=== Instances of $resource (non-namespaced) ===" + $KUBECTL get $resource + done +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# System Logs +# --------------------------- +{ + echo -e "\n=== systemd-networkd logs ===" + journalctl -u systemd-networkd + + echo -e "\n=== kernel logs ===" + journalctl -k + + echo -e "\n=== Kernel Network Logs ===" + dmesg | grep -i "network\|bond\|vlan" +} >> "$OUTPUT_FILE" 2>&1 echo "Diagnostics collected to $OUTPUT_FILE" diff --git a/pkg/hhfab/show-tech/server.sh b/pkg/hhfab/show-tech/server.sh index 48944cdc9..b3ce9fe2e 100644 --- a/pkg/hhfab/show-tech/server.sh +++ b/pkg/hhfab/show-tech/server.sh @@ -3,70 +3,148 @@ # SPDX-License-Identifier: Apache-2.0 # show-tech.sh: Collect diagnostics from a Flatcar Linux server. +set +e -# Set the output file OUTPUT_FILE="/tmp/show-tech.log" -# Clear the log file : > "$OUTPUT_FILE" -echo "=== System Information ===" >> "$OUTPUT_FILE" -uname -a >> "$OUTPUT_FILE" -cat /etc/os-release >> "$OUTPUT_FILE" - -echo -e "\n=== General Networkctl Status ===" >> "$OUTPUT_FILE" -networkctl status >> "$OUTPUT_FILE" - -echo -e "\n=== VLAN Configuration ===" >> "$OUTPUT_FILE" -ip -d link show type vlan >> "$OUTPUT_FILE" - -echo -e "\n=== IP Configuration ===" >> "$OUTPUT_FILE" -ip addr show >> "$OUTPUT_FILE" -ip route show >> "$OUTPUT_FILE" - -echo -e "\n=== Detailed Link Information ===" >> "$OUTPUT_FILE" -networkctl list >> "$OUTPUT_FILE" - -echo -e "\n=== Device Details ===" >> "$OUTPUT_FILE" -ip -d link show >> "$OUTPUT_FILE" - -echo -e "\n=== Bonding Configuration ===" >> "$OUTPUT_FILE" -cat /proc/net/bonding/* >> "$OUTPUT_FILE" 2>/dev/null || echo "No bonding configuration found." >> "$OUTPUT_FILE" - -echo -e "\n=== MTU Configuration ===" >> "$OUTPUT_FILE" -ip link show | grep mtu >> "$OUTPUT_FILE" - -echo "networkctl LLDP Data:" >> $OUTPUT_FILE -networkctl lldp >> $OUTPUT_FILE - -echo -e "\n=== DHCP Leases ===" >> "$OUTPUT_FILE" -cat /run/systemd/netif/leases/* >> "$OUTPUT_FILE" 2>/dev/null || echo "No DHCP leases found." >> "$OUTPUT_FILE" - -echo -e "\n=== NIC Information ===" >> "$OUTPUT_FILE" -for nic in $(ls /sys/class/net | grep -E '^enp|^eth'); do - echo -e "\n--- $nic ---" >> "$OUTPUT_FILE" - ethtool -k "$nic" >> "$OUTPUT_FILE" 2>/dev/null -done - -echo -e "\n=== Network Configuration Files ===" >> "$OUTPUT_FILE" -find /etc/systemd/network -type f -exec echo -e "\nFile: {}" \; -exec cat {} \; >> "$OUTPUT_FILE" - -echo -e "\n=== systemd-timesyncd Service Status ===" >> "$OUTPUT_FILE" -systemctl status systemd-timesyncd >> "$OUTPUT_FILE" - -echo -e "\n=== Timesync Status ===" >> "$OUTPUT_FILE" -timedatectl show-timesync >> "$OUTPUT_FILE" - -echo -e "\n=== Current Time Settings ===" >> "$OUTPUT_FILE" -timedatectl >> "$OUTPUT_FILE" - -echo -e "\n=== systemd-networkd logs ===" >> "$OUTPUT_FILE" -journalctl -u systemd-networkd >> "$OUTPUT_FILE" 2>/dev/null - -echo -e "\n=== kernel logs ===" >> "$OUTPUT_FILE" -journalctl -k >> "$OUTPUT_FILE" 2>/dev/null - -echo -e "\n=== Kernel Network Logs ===" >> "$OUTPUT_FILE" -dmesg | grep -i "network\|bond\|vlan" >> "$OUTPUT_FILE" +# --------------------------- +# Basic System Information +# --------------------------- +{ + echo "=== System Information ===" + uname -a + cat /etc/os-release +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Network Status & Configuration +# --------------------------- +{ + echo -e "\n=== General networkctl Status ===" + networkctl status + + echo -e "\n=== VLAN Configuration ===" + ip -d link show type vlan + + echo -e "\n=== IP Configuration ===" + ip addr show + ip route show table all +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Connectivity Tests +# --------------------------- +{ + DEFAULT_GW=$(ip route | awk '/^default/ {print $3}') + echo -e "\n=== Ping Default Gateway ($DEFAULT_GW) ===" + ping -c 1 "$DEFAULT_GW" 2>&1 + + echo -e "\n=== Ping Other Servers ===" + OWN_IP=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++) if($i=="src") {print $(i+1); exit}}') + for i in {1..9}; do + TARGET_IP="10.0.$i.2" + if [ "$TARGET_IP" == "$OWN_IP" ]; then + continue + fi + ping -c 1 "$TARGET_IP" 2>&1 + done +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Detailed Network Diagnostics +# --------------------------- +{ + echo -e "\n=== Detailed Link Information (networkctl list) ===" + networkctl list + + echo -e "\n=== Device Details (ip -d link show) ===" + ip -d link show + + echo -e "\n=== Bonding Configuration ===" + cat /proc/net/bonding/* 2>/dev/null || echo "No bonding configuration found." + + echo -e "\n=== MTU Configuration ===" + ip link show | grep mtu + + echo -e "\n=== LLDP Data (networkctl lldp) ===" + networkctl lldp + + echo -e "\n=== DHCP Leases ===" + cat /run/systemd/netif/leases/* 2>/dev/null || echo "No DHCP leases found." +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# NIC & Interface Diagnostics +# --------------------------- +{ + echo -e "\n=== NIC Information (ethtool) ===" + for nic in $(ls /sys/class/net | grep -E '^(enp|eth)'); do + echo -e "\n--- $nic ---" + ethtool -k "$nic" 2>/dev/null || echo "Could not retrieve ethtool data for $nic" + done + + echo -e "\n=== Network Configuration Files ===" + find /etc/systemd/network -type f -exec echo -e "\nFile: {}" \; -exec cat {} \; +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Time Synchronization & Services +# --------------------------- +{ + echo -e "\n=== systemd-timesyncd Service Status ===" + systemctl status systemd-timesyncd + + echo -e "\n=== Timesync Status ===" + timedatectl show-timesync + + echo -e "\n=== Current Time Settings ===" + timedatectl +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Logs & Kernel Information +# --------------------------- +{ + echo -e "\n=== hhnet logs ===" + cat /var/log/hhnet.log + + echo -e "\n=== SSH logs ===" + sudo journalctl | grep sshd + + echo -e "\n=== systemd-networkd logs ===" + journalctl -u systemd-networkd 2>/dev/null + + echo -e "\n=== Kernel logs ===" + journalctl -k 2>/dev/null + + echo -e "\n=== Kernel Network Logs (dmesg) ===" + dmesg | grep -i "network\|bond\|vlan" +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# Additional Diagnostics +# --------------------------- +{ + echo -e "\n=== ARP Table ===" + ip neigh show + + echo -e "\n=== Listening Ports (ss -tulnp) ===" + ss -tulnp 2>&1 + + echo -e "\n=== DNS Resolver Status ===" + cat /etc/resolv.conf + if command -v resolvectl &>/dev/null; then + resolvectl status 2>&1 + fi + + echo -e "\n=== Kernel Modules Related to Networking ===" + lsmod | grep -E 'bond|8021q|bridge' + + echo -e "\n=== Interface Statistics (ip -s link) ===" + ip -s link + +} >> "$OUTPUT_FILE" 2>&1 echo "Diagnostics collected to $OUTPUT_FILE" diff --git a/pkg/hhfab/show-tech/switch.sh b/pkg/hhfab/show-tech/switch.sh index 7fbfe933c..1a178c74e 100644 --- a/pkg/hhfab/show-tech/switch.sh +++ b/pkg/hhfab/show-tech/switch.sh @@ -3,39 +3,120 @@ # SPDX-License-Identifier: Apache-2.0 # show-tech.sh: Collect diagnostics from a SONiC switch. +set +e -# Set the output file OUTPUT_FILE="/tmp/show-tech.log" -# Clear the log file : > "$OUTPUT_FILE" -echo "=== SONiC Version ===" >> "$OUTPUT_FILE" -show version >> "$OUTPUT_FILE" 2>/dev/null +# Helper function for sonic-cli commands +run_sonic_cmd() { + echo -e "\n=== Executing: sonic-cli -c '$1' ===" | tee -a "$OUTPUT_FILE" + sonic-cli -c "$1 | no-more" >> "$OUTPUT_FILE" 2>/dev/null +} -echo -e "\n=== Interface Status ===" >> "$OUTPUT_FILE" -show interfaces status >> "$OUTPUT_FILE" 2>/dev/null +# --------------------------- +# Basic System Information +# --------------------------- +{ + echo "=== System Information ===" + run_sonic_cmd "show version" + run_sonic_cmd "show uptime" +} >> "$OUTPUT_FILE" 2>&1 -echo -e "\n=== Port Configuration ===" >> "$OUTPUT_FILE" -show runningconfiguration all >> "$OUTPUT_FILE" 2>/dev/null +# --------------------------- +# Interface Status +# --------------------------- +{ + echo -e "\n=== Interface Information ===" + run_sonic_cmd "show interface status" + run_sonic_cmd "show interface description" + run_sonic_cmd "show interface counters" + run_sonic_cmd "show lldp table" +} >> "$OUTPUT_FILE" 2>&1 -echo -e "\n=== VLAN Configuration ===" >> "$OUTPUT_FILE" -show vlan brief >> "$OUTPUT_FILE" 2>/dev/null +# --------------------------- +# VLAN and VXLAN Configuration +# --------------------------- +{ + echo -e "\n=== VLAN and VXLAN Configuration ===" + run_sonic_cmd "show running-configuration" + run_sonic_cmd "show vlan config" + run_sonic_cmd "show vlan brief" + run_sonic_cmd "show vxlan interface" + run_sonic_cmd "show vxlan vlan-vni" + run_sonic_cmd "show vxlan vrf-vni" + run_sonic_cmd "show vxlan tunnel" + run_sonic_cmd "show vxlan remote-vtep" +} >> "$OUTPUT_FILE" 2>&1 -echo -e "\n=== Routing Table ===" >> "$OUTPUT_FILE" -show ip route >> "$OUTPUT_FILE" 2>/dev/null +# --------------------------- +# L2 Information +# --------------------------- +{ + echo -e "\n=== L2 Information ===" + run_sonic_cmd "show mac address-table" + run_sonic_cmd "show mclag brief" + run_sonic_cmd "show mclag interface" + run_sonic_cmd "show port-channel summary" +} >> "$OUTPUT_FILE" 2>&1 -echo -e "\n=== ARP Table ===" >> "$OUTPUT_FILE" -show arp >> "$OUTPUT_FILE" 2>/dev/null +# --------------------------- +# BGP and EVPN Status +# --------------------------- +{ + echo -e "\n=== BGP and EVPN Status ===" + run_sonic_cmd "show ip bgp summary" + run_sonic_cmd "show bgp l2vpn evpn summary" + run_sonic_cmd "show bgp l2vpn evpn" + + echo -e "\n=== EVPN Information ===" + run_sonic_cmd "show evpn vni" + run_sonic_cmd "show evpn mac" + run_sonic_cmd "show evpn arp-cache" +} >> "$OUTPUT_FILE" 2>&1 -echo -e "\n=== Logs ===" >> "$OUTPUT_FILE" -show logging >> "$OUTPUT_FILE" 2>/dev/null +# --------------------------- +# Platform Information +# --------------------------- +{ + echo -e "\n=== Platform Details ===" + run_sonic_cmd "show platform environment" + run_sonic_cmd "show platform fanstatus" + run_sonic_cmd "show platform firmware" + run_sonic_cmd "show platform i2c errors" + run_sonic_cmd "show platform psusummary" + run_sonic_cmd "show platform ssdhealth" + run_sonic_cmd "show platform temperature" + + echo -e "\n=== Transceiver Information ===" + run_sonic_cmd "show interface transceiver summary" + run_sonic_cmd "show interface transceiver laser status" + run_sonic_cmd "show interface transceiver wattage" +} >> "$OUTPUT_FILE" 2>&1 -echo -e "\n=== Hedgehog agent status ===" >> "$OUTPUT_FILE" -systemctl status hedgehog-agent >> "$OUTPUT_FILE" 2>/dev/null - -echo -e "\n=== Hedgehog agent logs ===" >> "$OUTPUT_FILE" -cat /var/log/agent.log >> "$OUTPUT_FILE" 2>/dev/null +# --------------------------- +# System Logs and Status +# --------------------------- +{ + echo -e "\n=== System Logs ===" + run_sonic_cmd "show logging" + + echo -e "\n=== Hedgehog Agent Status ===" + systemctl status hedgehog-agent + + echo -e "\n=== Hedgehog Agent Logs ===" + cat /var/log/agent.log + + echo -e "\n=== Docker Status ===" + docker ps + + echo -e "\n=== Docker Container Logs ===" + CONTAINERS=$(docker ps --format "{{.Names}}") + for CONTAINER in $CONTAINERS; do + echo -e "\n--- Container: $CONTAINER ---" + docker logs --tail 100 "$CONTAINER" + done +} >> "$OUTPUT_FILE" 2>&1 echo "Diagnostics collected to $OUTPUT_FILE" - diff --git a/pkg/hhfab/vlabhelpers.go b/pkg/hhfab/vlabhelpers.go index 67a911cdb..933908d0f 100644 --- a/pkg/hhfab/vlabhelpers.go +++ b/pkg/hhfab/vlabhelpers.go @@ -646,7 +646,7 @@ func (c *Config) collectShowTech(ctx context.Context, entryName string, entry VL } chmodCmd := fmt.Sprintf("chmod +x %s && %s", remoteScriptPath, remoteScriptPath) - stdout, stderr, done, err := ssh.Run(chmodCmd, 60*time.Second) + stdout, stderr, done, err := ssh.Run(chmodCmd, 150*time.Second) if err != nil { return fmt.Errorf("executing show-tech on %s: %w", entryName, err) //nolint:goerr113 } From f4c0606402926174211f42d684d7ba74aab9d42a Mon Sep 17 00:00:00 2001 From: Pau Capdevila Date: Fri, 14 Feb 2025 20:17:25 +0100 Subject: [PATCH 2/4] Extend show-tech switch script Signed-off-by: Pau Capdevila --- pkg/hhfab/show-tech/switch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/hhfab/show-tech/switch.sh b/pkg/hhfab/show-tech/switch.sh index 1a178c74e..e0c6cd3b6 100644 --- a/pkg/hhfab/show-tech/switch.sh +++ b/pkg/hhfab/show-tech/switch.sh @@ -11,7 +11,7 @@ OUTPUT_FILE="/tmp/show-tech.log" # Helper function for sonic-cli commands run_sonic_cmd() { - echo -e "\n=== Executing: sonic-cli -c '$1' ===" | tee -a "$OUTPUT_FILE" + echo -e "\n=== Executing: sonic-cli -c '$1' ===" >> "$OUTPUT_FILE" sonic-cli -c "$1 | no-more" >> "$OUTPUT_FILE" 2>/dev/null } From c831718531997d6c56f24e9f7356882bc891d278 Mon Sep 17 00:00:00 2001 From: Pau Capdevila Date: Tue, 18 Feb 2025 19:23:06 +0100 Subject: [PATCH 3/4] Extend show-tech switch with bcmsh commands Signed-off-by: Pau Capdevila --- pkg/hhfab/show-tech/switch.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/hhfab/show-tech/switch.sh b/pkg/hhfab/show-tech/switch.sh index e0c6cd3b6..3e70440f3 100644 --- a/pkg/hhfab/show-tech/switch.sh +++ b/pkg/hhfab/show-tech/switch.sh @@ -95,6 +95,18 @@ run_sonic_cmd() { run_sonic_cmd "show interface transceiver wattage" } >> "$OUTPUT_FILE" 2>&1 +# --------------------------- +# Broadcom SDK Diagnostics +# --------------------------- +{ + echo -e "\n=== Broadcom Port Status ===" + bcmcmd "ps" + + echo -e "\n=== Broadcom PHY Information ===" + bcmcmd "phy info" + +} >> "$OUTPUT_FILE" 2>&1 + # --------------------------- # System Logs and Status # --------------------------- From abe3ef4bf6dba2682039d01d0d4515f3b5eb40b8 Mon Sep 17 00:00:00 2001 From: Pau Capdevila Date: Wed, 19 Feb 2025 12:07:07 +0100 Subject: [PATCH 4/4] Reorganize show-tech switch script Signed-off-by: Pau Capdevila --- pkg/hhfab/show-tech/switch.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/hhfab/show-tech/switch.sh b/pkg/hhfab/show-tech/switch.sh index 3e70440f3..2380198e4 100644 --- a/pkg/hhfab/show-tech/switch.sh +++ b/pkg/hhfab/show-tech/switch.sh @@ -30,17 +30,25 @@ run_sonic_cmd() { { echo -e "\n=== Interface Information ===" run_sonic_cmd "show interface status" + run_sonic_cmd "show interface status err-disabled" run_sonic_cmd "show interface description" run_sonic_cmd "show interface counters" run_sonic_cmd "show lldp table" } >> "$OUTPUT_FILE" 2>&1 # --------------------------- -# VLAN and VXLAN Configuration +# Configuration # --------------------------- { - echo -e "\n=== VLAN and VXLAN Configuration ===" + echo -e "\n=== Running Configuration ===" run_sonic_cmd "show running-configuration" +} >> "$OUTPUT_FILE" 2>&1 + +# --------------------------- +# VLAN and VXLAN Information +# --------------------------- +{ + echo -e "\n=== VLAN and VXLAN Information ===" run_sonic_cmd "show vlan config" run_sonic_cmd "show vlan brief" run_sonic_cmd "show vxlan interface"