[action] [PR:3488] Enable show interfacess counters on chassis supervisor (#3488) #3529
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
I modify the portstat script and the implementation of Class Porstat to enable the Chassis Supervisor to collect port counters from linecards. By doing so, "show interfaces counters" on the Chassis Supervisor can now collect port counters from linecards and display them on the CLI.
How I did it
I made the Class Portstat aware of chassis environment and added logic to collect port counters from linecards through "GET_LINECARD_COUNTER|pull" signal in CHASSIS_STATE_DB. And I also added an agent on every linecard to collect port counters and send them to CHASSIS_STATE_DB on the Chassis Supervisor.
Note: the agent is not part of this PR. The current agent used in my test is only for internal use in MSFT.
How to verify it
Run it on a SONiC Chassis Supervisor and make sure the Linecards are equipped with agents to publish port counters to CHASSIS_STATE_DB.