forked from sonic-net/sonic-utilities
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable show interfacess counters on chassis supervisor (sonic-net#3488)
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.
- Loading branch information
Showing
7 changed files
with
890 additions
and
530 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
tests/portstat_db/on_sup_no_counters/chassis_state_db.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"CHASSIS_MODULE_HOSTNAME_TABLE|LINE-CARD0": { | ||
"module_hostname": "sonic-lc1" | ||
}, | ||
"CHASSIS_MODULE_HOSTNAME_TABLE|LINE-CARD1": { | ||
"module_hostname": "sonic-lc2" | ||
}, | ||
"CHASSIS_MODULE_HOSTNAME_TABLE|LINE-CARD2": { | ||
"module_hostname": "sonic-lc3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"CHASSIS_MODULE_HOSTNAME_TABLE|LINE-CARD0": { | ||
"module_hostname": "sonic-lc1" | ||
}, | ||
"CHASSIS_MODULE_HOSTNAME_TABLE|LINE-CARD1": { | ||
"module_hostname": "sonic-lc2" | ||
}, | ||
"CHASSIS_MODULE_HOSTNAME_TABLE|LINE-CARD2": { | ||
"module_hostname": "sonic-lc3" | ||
}, | ||
"LINECARD_PORT_STAT_MARK_TABLE|sonic-lc1": { | ||
"timestamp": "2020-07-01 00:00:00" | ||
}, | ||
"LINECARD_PORT_STAT_TABLE|Ethernet1/1": { | ||
"state": "U", | ||
"rx_ok": 100, | ||
"rx_bps": 10, | ||
"rx_pps": 1, | ||
"rx_util": 0, | ||
"rx_err": 0, | ||
"rx_drop": 0, | ||
"rx_ovr": 0, | ||
"tx_ok": 100, | ||
"tx_bps": 10, | ||
"tx_pps": 1, | ||
"tx_util": 0, | ||
"tx_err": 0, | ||
"tx_drop": 0, | ||
"tx_ovr": 0 | ||
}, | ||
"LINECARD_PORT_STAT_TABLE|Ethernet2/1": { | ||
"state": "U", | ||
"rx_ok": 100, | ||
"rx_bps": 10, | ||
"rx_pps": 1, | ||
"rx_util": 0, | ||
"rx_err": 0, | ||
"rx_drop": 0, | ||
"rx_ovr": 0, | ||
"tx_ok": 100, | ||
"tx_bps": 10, | ||
"tx_pps": 1, | ||
"tx_util": 0, | ||
"tx_err": 0, | ||
"tx_drop": 0, | ||
"tx_ovr": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.