File tree Expand file tree Collapse file tree 10 files changed +82
-66
lines changed
Expand file tree Collapse file tree 10 files changed +82
-66
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ COPY ["snmp.conf", "/etc/snmp/frr.conf"]
5353COPY ["TSA", "/usr/bin/TSA"]
5454COPY ["TSB", "/usr/bin/TSB"]
5555COPY ["TSC", "/usr/bin/TSC"]
56+ COPY ["TS", "/usr/bin/TS"]
5657COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
5758COPY ["zsocket.sh", "/usr/bin/"]
5859RUN chmod a+x /usr/bin/TSA && \
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Check whether the routemap is for internal BGP sessions.
4+ function is_internal_route_map()
5+ {
6+ [[ " $1 " =~ .* " _INTERNAL_" .* ]]
7+ }
8+
9+ function check_not_installed()
10+ {
11+ c=0
12+ config=$( vtysh -c " show run" )
13+ for route_map_name in $( echo " $config " | sed -ne ' s/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep ' V4|V6' ) ;
14+ do
15+ is_internal_route_map $route_map_name && continue
16+ echo " $config " | egrep -q " ^route-map $route_map_name permit 20$"
17+ c=$(( c+ $? ))
18+ echo " $config " | egrep -q " ^route-map $route_map_name deny 30$"
19+ c=$(( c+ $? ))
20+ done
21+ return $c
22+ }
23+
24+ function check_installed()
25+ {
26+ c=0
27+ e=0
28+ config=$( vtysh -c " show run" )
29+ for route_map_name in $( echo " $config " | sed -ne ' s/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep ' V4|V6' ) ;
30+ do
31+ is_internal_route_map $route_map_name && continue
32+ echo " $config " | egrep -q " ^route-map $route_map_name permit 20$"
33+ c=$(( c+ $? ))
34+ e=$(( e+ 1 ))
35+ echo " $config " | egrep -q " ^route-map $route_map_name deny 30$"
36+ c=$(( c+ $? ))
37+ e=$(( e+ 1 ))
38+ done
39+ return $(( e- c))
40+ }
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- function check_not_installed()
4- {
5- c=0
6- config=$( vtysh -c " show run" )
7- for route_map_name in $( echo " $config " | sed -ne ' s/ neighbor \S* route-map \(\S*\) out/\1/p' ) ;
8- do
9- echo " $config " | egrep -q " ^route-map $route_map_name permit 20$"
10- c=$(( c+ $? ))
11- echo " $config " | egrep -q " ^route-map $route_map_name deny 30$"
12- c=$(( c+ $? ))
13- done
14- return $c
15- }
3+ # Load the common functions
4+ source /usr/bin/TS
165
176check_not_installed
187not_installed=$?
2110 TSA_FILE=$( mktemp)
2211 for route_map_name in $( echo " $config " | sed -ne ' s/ neighbor \S* route-map \(\S*\) out/\1/p' ) ;
2312 do
13+ is_internal_route_map $route_map_name && continue
2414 case " $route_map_name " in
2515 * V4* )
2616 ip_version=V4
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- function check_installed()
4- {
5- c=0
6- e=0
7- config=$( vtysh -c " show run" )
8- for route_map_name in $( echo " $config " | sed -ne ' s/ neighbor \S* route-map \(\S*\) out/\1/p' ) ;
9- do
10- echo " $config " | egrep -q " ^route-map $route_map_name permit 20$"
11- c=$(( c+ $? ))
12- e=$(( e+ 1 ))
13- echo " $config " | egrep -q " ^route-map $route_map_name deny 30$"
14- c=$(( c+ $? ))
15- e=$(( e+ 1 ))
16- done
17- return $(( e- c))
18- }
3+ # Load the common functions
4+ source /usr/bin/TS
195
206check_installed
217installed=$?
2410 TSB_FILE=$( mktemp)
2511 for route_map_name in $( echo " $config " | sed -ne ' s/ neighbor \S* route-map \(\S*\) out/\1/p' ) ;
2612 do
13+ is_internal_route_map $route_map_name && continue
2714 case " $route_map_name " in
2815 * V4* )
2916 ;;
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- function check_not_installed()
4- {
5- c=0
6- config=$( vtysh -c " show run" )
7- for route_map_name in $( echo " $config " | sed -ne ' s/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep ' V4|V6' ) ;
8- do
9- echo " $config " | egrep -q " ^route-map $route_map_name permit 20$"
10- c=$(( c+ $? ))
11- echo " $config " | egrep -q " ^route-map $route_map_name deny 30$"
12- c=$(( c+ $? ))
13- done
14- return $c
15- }
16-
17- function check_installed()
18- {
19- c=0
20- e=0
21- config=$( vtysh -c " show run" )
22- for route_map_name in $( echo " $config " | sed -ne ' s/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep ' V4|V6' ) ;
23- do
24- echo " $config " | egrep -q " ^route-map $route_map_name permit 20$"
25- c=$(( c+ $? ))
26- e=$(( e+ 1 ))
27- echo " $config " | egrep -q " ^route-map $route_map_name deny 30$"
28- c=$(( c+ $? ))
29- e=$(( e+ 1 ))
30- done
31- return $(( e- c))
32- }
33-
34- echo " Traffic Shift Check:"
3+ # Load the common functions
4+ source /usr/bin/TS
355
366check_not_installed
377not_installed=$?
4818else
4919 echo " System Mode: Not consistent"
5020fi
51-
52- echo
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # read SONiC immutable variables
4+ [ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment
5+
6+ PLATFORM=${PLATFORM:- `sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
7+
8+ # Parse the device specific asic conf file, if it exists
9+ ASIC_CONF=/usr/share/sonic/device/$PLATFORM /asic.conf
10+ [ -f $ASIC_CONF ] && . $ASIC_CONF
11+
12+ if [[ ($NUM_ASIC -gt 1) ]]; then
13+ asic=0
14+ NAMESPACE_PREFIX=' asic'
15+
16+ while [ $asic -lt $NUM_ASIC ]
17+ do
18+ # Run TSA/TSB/TSC scripts in BGP instance for frontend ASICs.
19+ sub_role=` sonic-cfggen -d -v " DEVICE_METADATA['localhost']['sub_role']" -n $NAMESPACE_PREFIX$asic `
20+ if [ $sub_role == ' FrontEnd' ]
21+ then
22+ echo -e " BGP" $asic " : \c"
23+ docker exec -i bgp$asic /usr/bin/$1
24+ fi
25+ asic=$[$asic +1]
26+ done
27+ else
28+ docker exec -i bgp /usr/bin/$1
29+ fi
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- docker exec -i bgp /usr/bin/TSA
3+ /usr/bin/TS TSA
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- docker exec -i bgp /usr/bin/TSB
3+ /usr/bin/TS TSB
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- docker exec -i bgp /usr/bin/TSC
3+ /usr/bin/TS TSC
44
55portstat -p 5
Original file line number Diff line number Diff line change @@ -30,4 +30,5 @@ $(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += vtysh:/usr/bin/vtysh
3030$(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TSA:/usr/bin/TSA
3131$(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TSB:/usr/bin/TSB
3232$(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TSC:/usr/bin/TSC
33+ $(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TS:/usr/bin/TS
3334$(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += monit_bgp:/etc/monit/conf.d
You can’t perform that action at this time.
0 commit comments