Skip to content

Commit 415d30e

Browse files
dgsudharsanyxieca
authored andcommitted
[techsupport] Adding FRR EVPN dumps (#2442)
- What I did Adding FRR related evpn dumps to techsupport - How I did it Added vtysh commands in generate_dump to dump required EVPN related information - How to verify it Run techsupport and check if the commands are dumped
1 parent b3ffe45 commit 415d30e

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

scripts/generate_dump

+74
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,40 @@ save_bgp_neighbor() {
527527
done
528528
}
529529

530+
###############################################################################
531+
# Iterates all EVPN neighbors and runs save_vtysh to save each neighbor's
532+
# advertised-routes and received-routes
533+
# On multi ASIC platform, collects information from all namespaces
534+
# Globals:
535+
# None
536+
# Arguments:
537+
# Optional arg namespace
538+
# Returns:
539+
# None
540+
###############################################################################
541+
save_bgp_evpn_neighbor() {
542+
trap 'handle_error $? $LINENO' ERR
543+
local timeout_cmd="timeout --foreground ${TIMEOUT_MIN}m"
544+
local asic_id=${1:-""}
545+
local ns=$(get_vtysh_namespace $asic_id)
546+
547+
evpn_neighbors=$(${timeout_cmd} bash -c "vtysh -c 'show bgp l2vpn evpn summary' | cut -d ' ' -f1")
548+
local parse_neighbors=false
549+
for word in $evpn_neighbors; do
550+
if [[ $word == "Neighbor" ]]; then
551+
parse_neighbors=true
552+
continue
553+
elif [[ $word == "Total" ]]; then
554+
parse_neighbors=false
555+
continue
556+
fi
557+
if [ "$parse_neighbors" = true ]; then
558+
save_cmd "vtysh $ns -c \"show bgp l2vpn evpn neighbors $word advertised-routes\"" "bgp.evpn.neighbor.$word.adv$asic_id"
559+
save_cmd "vtysh $ns -c \"show bgp l2vpn evpn neighbors $word routes\"" "bgp.evpn.neighbor.$word.rcv$asic_id"
560+
fi
561+
done
562+
}
563+
530564
###############################################################################
531565
# Iterates all ASIC namespaces on multi ASIC platform and on default (host)
532566
# namespace on single ASIC platform
@@ -549,6 +583,28 @@ save_bgp_neighbor_all_ns() {
549583
fi
550584
}
551585

586+
###############################################################################
587+
# Iterates all ASIC namespaces on multi ASIC platform and on default (host)
588+
# namespace on single ASIC platform
589+
# Globals:
590+
# NUM_ASICS
591+
# Arguments:
592+
# None
593+
# Returns:
594+
# None
595+
###############################################################################
596+
save_bgp_evpn_neighbor_all_ns() {
597+
trap 'handle_error $? $LINENO' ERR
598+
if [[ ( "$NUM_ASICS" == 1 ) ]] ; then
599+
save_bgp_evpn_neighbor
600+
else
601+
for (( i=0; i<$NUM_ASICS; i++ ))
602+
do
603+
save_bgp_evpn_neighbor $i
604+
done
605+
fi
606+
}
607+
552608
###############################################################################
553609
# Dump the nat config, iptables rules and conntrack nat entries
554610
# Globals:
@@ -624,6 +680,23 @@ save_bgp_info() {
624680
save_bgp_neighbor_all_ns
625681
}
626682

683+
###############################################################################
684+
# Save EVPN related info
685+
# Globals:
686+
# None
687+
# Arguments:
688+
# None
689+
# Returns:
690+
# None
691+
###############################################################################
692+
save_evpn_info() {
693+
trap 'handle_error $? $LINENO' ERR
694+
save_vtysh "show bgp l2vpn evpn" "bgp.l2vpn.evpn"
695+
save_vtysh "show bgp l2vpn evpn route detail" "bgp.evpn.route"
696+
save_vtysh "show evpn vni detail" "bgp.evpn.vni"
697+
save_vtysh "show evpn arp-cache vni all" "bgp.evpn.arp"
698+
save_bgp_evpn_neighbor_all_ns
699+
}
627700
###############################################################################
628701
# Save FRR related info
629702
# Globals:
@@ -1323,6 +1396,7 @@ main() {
13231396

13241397
save_frr_info
13251398
save_bgp_info
1399+
save_evpn_info
13261400

13271401
save_cmd "show interface status -d all" "interface.status"
13281402
save_cmd "show interface transceiver presence" "interface.xcvrs.presence"

0 commit comments

Comments
 (0)