Skip to content

Commit

Permalink
[202012] [techsupport] Techsupport Error Reporting pending fixes (#1854)
Browse files Browse the repository at this point in the history
#### What I did

This PR include some fixes which were missed while manually porting the error reporting PR onto 202012 #1833. 

i.e. removing -it option from the docker exec commands. to understand why the -it option was removed, refer #1723 

This also include another fix which removes -d from the show ip interface command, which fails otherwise.

**Note:** -d option for "show ip interface" is working on master and 202106. and not for 202012. So, this change is particular to 202012. 

Master:
```
admin@sonic-master-imge:~$ show ip interfaces -d all
Interface        Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
---------------  --------  -------------------  ------------  --------------  -------------
Loopback0                  10.1.0.32/32         up/up         N/A             N/A
PortChannel0001            10.0.0.56/31         up/up         ARISTA01T1      10.0.0.57
PortChannel0002            10.0.0.58/31         up/up         ARISTA02T1      10.0.0.59
PortChannel0003            10.0.0.60/31         up/up         ARISTA03T1      10.0.0.61
PortChannel0004            10.0.0.62/31         up/up         ARISTA04T1      10.0.0.63
Vlan1000                   192.168.0.1/21       up/up         N/A             N/A
docker0                    240.127.1.1/24       up/down       N/A             N/A
eth0                       10.75.206.180/24     up/up         N/A             N/A
lo                         127.0.0.1/16         up/up         N/A             N/A
```

202012:
```
admin@sonic-202012-image:~$ show ip interfaces -d all
Usage: show ip interfaces [OPTIONS]
Try "show ip interfaces -h" for help.

Error: no such option: -d
```



#### How I did it

#### How to verify it

- Run the show tech-support and check the return status. It should be zero. (Atleast, it was on mellanox platform. I couldn't check the functions which were platform specific)
- Run the "show techsupport" test.
  • Loading branch information
vivekrnv committed Nov 8, 2021
1 parent 8b2ec09 commit 48035d7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,11 @@ save_redis() {
save_saidump() {
trap 'handle_error $? $LINENO' ERR
if [[ ( "$NUM_ASICS" == 1 ) ]] ; then
save_cmd "docker exec -it syncd saidump" "saidump"
save_cmd "docker exec syncd saidump" "saidump"
else
for (( i=0; i<$NUM_ASICS; i++ ))
do
save_cmd "docker exec -it syncd$i saidump" "saidump$i"
save_cmd "docker exec syncd$i saidump" "saidump$i"
done
fi
}
Expand Down Expand Up @@ -807,7 +807,7 @@ enable_logrotate() {
collect_mellanox() {
trap 'handle_error $? $LINENO' ERR
local sai_dump_filename="/tmp/sai_sdk_dump_$(date +"%m_%d_%Y_%I_%M_%p")"
${CMD_PREFIX}docker exec -it syncd saisdkdump -f $sai_dump_filename
${CMD_PREFIX}docker exec syncd saisdkdump -f $sai_dump_filename
${CMD_PREFIX}docker exec syncd tar Ccf $(dirname $sai_dump_filename) - $(basename $sai_dump_filename) | tar Cxf /tmp/ -
save_file $sai_dump_filename sai_sdk_dump true

Expand Down Expand Up @@ -1161,7 +1161,7 @@ main() {
save_cmd "show interface status -d all" "interface.status"
save_cmd "show interface transceiver presence" "interface.xcvrs.presence"
save_cmd "show interface transceiver eeprom --dom" "interface.xcvrs.eeprom"
save_cmd "show ip interface -d all" "ip.interface"
save_cmd "show ip interface" "ip.interface"

save_cmd "lldpctl" "lldpctl"
if [[ ( "$NUM_ASICS" > 1 ) ]]; then
Expand Down Expand Up @@ -1266,7 +1266,11 @@ main() {
fi

echo ${TARFILE}
exit $RETURN_CODE

if ! $SAVE_STDERR
then
exit $RETURN_CODE
fi
}

###############################################################################
Expand Down

0 comments on commit 48035d7

Please sign in to comment.