Skip to content

Commit ca814a6

Browse files
committed
feat(show-tech): get control kubectl fabric inspects
Signed-off-by: Pau Capdevila <[email protected]>
1 parent caea80f commit ca814a6

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

pkg/hhfab/show-tech/control.sh

+52
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set +e
77

88
OUTPUT_FILE="/tmp/show-tech.log"
99
KUBECTL="/opt/bin/kubectl"
10+
FABRIC="$KUBECTL fabric"
1011

1112
: > "$OUTPUT_FILE"
1213

@@ -51,6 +52,56 @@ KUBECTL="/opt/bin/kubectl"
5152
$KUBECTL get events -A
5253
} >> "$OUTPUT_FILE" 2>&1
5354

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+
54105
# ---------------------------
55106
# Detailed Pod Information
56107
# ---------------------------
@@ -105,3 +156,4 @@ KUBECTL="/opt/bin/kubectl"
105156
} >> "$OUTPUT_FILE" 2>&1
106157

107158
echo "Diagnostics collected to $OUTPUT_FILE"
159+
echo "Wiring diagram exported to /tmp/wiring-export.yaml"

0 commit comments

Comments
 (0)