|
7 | 7 |
|
8 | 8 | OUTPUT_FILE="/tmp/show-tech.log"
|
9 | 9 | KUBECTL="/opt/bin/kubectl"
|
| 10 | +FABRIC="$KUBECTL fabric" |
10 | 11 |
|
11 | 12 | : > "$OUTPUT_FILE"
|
12 | 13 |
|
@@ -51,6 +52,56 @@ KUBECTL="/opt/bin/kubectl"
|
51 | 52 | $KUBECTL get events -A
|
52 | 53 | } >> "$OUTPUT_FILE" 2>&1
|
53 | 54 |
|
| 55 | +# --------------------------- |
| 56 | +# Fabric Inspection |
| 57 | +# --------------------------- |
| 58 | +{ |
| 59 | + echo -e "\n=== Fabric Overview Inspection ===" |
| 60 | + $FABRIC inspect fabric |
| 61 | + |
| 62 | + echo -e "\n=== BGP Neighbors Inspection ===" |
| 63 | + $FABRIC inspect bgp |
| 64 | + |
| 65 | + echo -e "\n=== LLDP Neighbors Inspection ===" |
| 66 | + $FABRIC inspect lldp |
| 67 | + |
| 68 | + echo -e "\n=== Gathering Switch Information ===" |
| 69 | + for switch in $($KUBECTL get switches.githedgehog.com -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do |
| 70 | + echo -e "\n=== Switch Inspection: $switch ===" |
| 71 | + $FABRIC inspect switch --name=$switch |
| 72 | + done |
| 73 | + |
| 74 | + echo -e "\n=== Gathering VPC Information ===" |
| 75 | + for vpc in $($KUBECTL get vpcs.githedgehog.com -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do |
| 76 | + echo -e "\n=== VPC Inspection: $vpc ===" |
| 77 | + $FABRIC inspect vpc --name=$vpc |
| 78 | + done |
| 79 | + |
| 80 | + echo -e "\n=== Gathering Connection Information ===" |
| 81 | + for conn in $($KUBECTL get connections.githedgehog.com -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do |
| 82 | + echo -e "\n=== Connection Inspection: $conn ===" |
| 83 | + $FABRIC inspect connection --name=$conn |
| 84 | + done |
| 85 | + |
| 86 | + echo -e "\n=== Listing Management Connections ===" |
| 87 | + $FABRIC connection get management |
| 88 | + |
| 89 | + echo -e "\n=== Listing Fabric Connections ===" |
| 90 | + $FABRIC connection get fabric |
| 91 | + |
| 92 | + echo -e "\n=== Listing VPC Loopback Connections ===" |
| 93 | + $FABRIC connection get vpc-loopback |
| 94 | + |
| 95 | + echo -e "\n=== Gathering Server Information ===" |
| 96 | + for server in $($KUBECTL get servers.githedgehog.com -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do |
| 97 | + echo -e "\n=== Server Inspection: $server ===" |
| 98 | + $FABRIC inspect server --name=$server |
| 99 | + done |
| 100 | + |
| 101 | + echo -e "\n=== Exporting Wiring Diagram ===" |
| 102 | + $FABRIC wiring export > "/tmp/wiring-export.yaml" |
| 103 | +} >> "$OUTPUT_FILE" 2>&1 |
| 104 | + |
54 | 105 | # ---------------------------
|
55 | 106 | # Detailed Pod Information
|
56 | 107 | # ---------------------------
|
@@ -105,3 +156,4 @@ KUBECTL="/opt/bin/kubectl"
|
105 | 156 | } >> "$OUTPUT_FILE" 2>&1
|
106 | 157 |
|
107 | 158 | echo "Diagnostics collected to $OUTPUT_FILE"
|
| 159 | +echo "Wiring diagram exported to /tmp/wiring-export.yaml" |
0 commit comments