Skip to content

Make show int stat on supervisor trigger rexec#4529

Open
Javier-Tan wants to merge 3 commits into
sonic-net:masterfrom
Javier-Tan:rexec_show_int_stat_on_chassis
Open

Make show int stat on supervisor trigger rexec#4529
Javier-Tan wants to merge 3 commits into
sonic-net:masterfrom
Javier-Tan:rexec_show_int_stat_on_chassis

Conversation

@Javier-Tan
Copy link
Copy Markdown

@Javier-Tan Javier-Tan commented May 7, 2026

Fixes sonic-net/sonic-buildimage#27222

What I did

Change show int stat on chassis supervisor to trigger rexec, to return show int stat output from LCs (as happens when running show ip bgp ... on supervisors)

How I did it

Add the same functionality under status as is under bgp functions

How to verify it

Edited python file on device, to ensure it works

Previous command output (if the output of a command-line utility has changed)

admin@t2_supervisor:~$ show int stat
  Interface    Lanes    Speed    MTU    FEC    Alias    Vlan    Oper    Admin    Type    Asym PFC
-----------  -------  -------  -----  -----  -------  ------  ------  -------  ------  ----------

New command output (if the output of a command-line utility has changed)

admin@t2_supervisor:~$ show int stat
Since the current device is a chassis supervisor, this command will be executed remotely on all linecards
Password for username 'admin':
======== LINE-CARD0|None output: ========
     Interface            Lanes    Speed    MTU    FEC         Alias            Vlan    Oper    Admin             Type    Asym PFC
--------------  ---------------  -------  -----  -----  ------------  --------------  ------  -------  ---------------  ----------
     Ethernet0      72,73,74,75     100G   9100     rs   Ethernet1/1  PortChannel102      up       up  QSFP28 or later         off
     Ethernet8      80,81,82,83     100G   9100     rs   Ethernet2/1  PortChannel102      up       up  QSFP28 or later         off
    Ethernet16      88,89,90,91     100G   9100     rs   Ethernet3/1  PortChannel104      up       up  QSFP28 or later         off
... 

======== LINE-CARD1|None output: ========
     Interface            Lanes    Speed    MTU    FEC         Alias            Vlan    Oper    Admin             Type    Asym PFC
--------------  ---------------  -------  -----  -----  ------------  --------------  ------  -------  ---------------  ----------
     Ethernet0      72,73,74,75     100G   9100     rs   Ethernet1/1  PortChannel101      up       up  QSFP28 or later         off
     Ethernet8      80,81,82,83     100G   9100     rs   Ethernet2/1  PortChannel101      up       up  QSFP28 or later         off
    Ethernet16      88,89,90,91     100G   9100     rs   Ethernet3/1  PortChannel103      up       up  QSFP28 or later         off
...

======== LINE-CARD2|None output: ========
     Interface            Lanes    Speed    MTU    FEC         Alias            Vlan    Oper    Admin             Type    Asym PFC
--------------  ---------------  -------  -----  -----  ------------  --------------  ------  -------  ---------------  ----------
     Ethernet0      72,73,74,75     100G   9100     rs   Ethernet1/1  PortChannel149      up       up  QSFP28 or later         off
     Ethernet8      80,81,82,83     100G   9100     rs   Ethernet2/1  PortChannel149      up       up  QSFP28 or later         off
    Ethernet16      88,89,90,91     100G   9100     rs   Ethernet3/1  PortChannel150      up       up  QSFP28 or later         off
...

Signed-off-by: Javier-Tan <47554099+Javier-Tan@users.noreply.github.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

Copilot AI review requested due to automatic review settings May 7, 2026 04:05
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates show int stat behavior on chassis supervisors so it triggers rexec and returns consolidated interface status from all linecards, aligning with other supervisor “fan-out” show commands.

Changes:

  • Detect supervisor context in show interfaces status and execute the same command remotely on all linecards via rexec all.
  • Print a user-facing message indicating the command is being run remotely.
  • Exit with the remote execution’s return code.

Comment thread show/interfaces/__init__.py
Comment thread show/interfaces/__init__.py
Comment thread show/interfaces/__init__.py
Signed-off-by: Javier-Tan <47554099+Javier-Tan@users.noreply.github.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

Copy link
Copy Markdown

@liamkearney-msft liamkearney-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Maybe we should think about putting this rexec logic / print into a common function to use here / for show ip bgp.

Then if we want to apply this to more commands we dont keep duplicating.
We can do this on next occurrence though, if you dont want to change that here in this PR

@Javier-Tan
Copy link
Copy Markdown
Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld
Copy link
Copy Markdown
Collaborator

No Azure DevOps builds found for #4529.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Javier-Tan <47554099+Javier-Tan@users.noreply.github.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: show int stat on chassis supervisor should trigger rexec to get info on LCs like show ip bgp sum

4 participants