Skip to content

Commit c34941f

Browse files
authored
Enhance ARP_UPDATE to make it more informative (#23298)
* add a check for generation of ARP_UPDATE_VARS * downgrade the logging level when the static route entry does not have ifname * check return code instead of stdout
1 parent 372dee3 commit c34941f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

files/scripts/arp_update

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ logger () {
1717
while /bin/true; do
1818
# find L3 interfaces which are UP, send ipv6 multicast pings
1919
ARP_UPDATE_VARS=$(sonic-cfggen -d -t ${ARP_UPDATE_VARS_FILE})
20+
if [ $? -ne 0 ]; then
21+
logger -p error "arp_update_vars cannot be generated"
22+
sleep 300
23+
continue
24+
fi
25+
2026
SWITCH_TYPE=$(echo $ARP_UPDATE_VARS | jq -r '.switch_type')
2127
TYPE=$(echo $ARP_UPDATE_VARS | jq -r '.type')
2228
if [[ "$SWITCH_TYPE" == "chassis-packet" ]] || [[ "$TYPE" == "BackEndToRRouter" ]]; then
@@ -48,7 +54,7 @@ while /bin/true; do
4854
interface="${STATIC_ROUTE_IFNAMES[i]}"
4955
if [[ -z "$interface" ]]; then
5056
# should never be here, handling just in case
51-
logger -p error "missing interface entry for static route $nexthop"
57+
logger -p warning "missing interface entry for static route $nexthop"
5258
continue
5359
fi
5460
intf_up=$(ip link show $interface | grep "state UP")

0 commit comments

Comments
 (0)