Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[psushow & psuutil] Support PSU power threshold checking #2326

Merged
merged 10 commits into from
Nov 21, 2022

Conversation

stephenxs
Copy link
Collaborator

@stephenxs stephenxs commented Aug 23, 2022

What I did

Support PSU power threshold checking

  1. Introduce a new state for the PSU, indicating whether a PSU power threshold is exceeded
  2. For psuutil, expose the power thresholds
  3. Add HW Rev to psuutil

Signed-off-by: Stephen Sun stephens@nvidia.com

How I did it

How to verify it

Unit and manual test

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

show platform psustatus

admin@sonic:~$ show platform  psustatus
PSU    Model          Serial        HW Rev      Voltage (V)    Current (A)    Power (W)  Status  LED
-----  -------------  ------------  --------  -------------  -------------  -----------  ------- -----
PSU 1  MTEF-PSF-AC-A  MT1629X14911  A3                12.08           5.19        62.62  OK      green
PSU 2  MTEF-PSF-AC-A  MT1629X14913  A3                12.01           4.38        52.50  OK      green

psuutil

admin@sonic:~$ show platform psustatus
PSU   Model         Serial       HW Rev   Voltage (V)   Current (A)   Power (W)   Status LED
----- ------------- ------------ -------- ------------- ------------- ----------- ------- -----
PSU 1 MTEF-PSF-AC-A MT1843K17965 A4               12.02          3.62       43.56 OK      green
PSU 2 MTEF-PSF-AC-A MT1843K17966 A4               12.04          4.25       51.12 OK      green

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

show platform psustatus
WARNING state can be seen.

admin@sonic:~$ show platform  psustatus
PSU    Model          Serial        HW Rev      Voltage (V)    Current (A)    Power (W)  Status  LED
-----  -------------  ------------  --------  -------------  -------------  -----------  ------- -----
PSU 1  MTEF-PSF-AC-A  MT1629X14911  A3                12.08           5.19        62.62  WARNING green
PSU 2  MTEF-PSF-AC-A  MT1629X14913  A3                12.01           4.38        52.50  OK      green

psuutil

admin@sonic:~$ psuutil
PSU   Model         Serial       HW Rev   Voltage (V)   Current (A)   Power (W)   Power Warn-supp Thres (W)   Power Crit Thres (W)    Status LED
----- ------------- ------------ -------- ------------- ------------- ----------- --------------------------- ---------------------- ------- -----
PSU 1 MTEF-PSF-AC-A MT1843K17965 A4               12.02          3.62       43.56                       38.00                  58.00 OK      green
PSU 2 MTEF-PSF-AC-A MT1843K17966 A4               12.04          4.25       51.12                       38.00                  58.00 OK      green

@lgtm-com
Copy link

lgtm-com bot commented Aug 23, 2022

This pull request introduces 2 alerts when merging f5165b3 into e14f679 - view on LGTM.com

new alerts:

  • 2 for Testing equality to None

@stephenxs stephenxs marked this pull request as ready for review August 26, 2022 09:57
@stephenxs stephenxs changed the title Support PSU power threshold checking [psushow & psuutil] Support PSU power threshold checking Aug 29, 2022
keboliu
keboliu previously approved these changes Nov 9, 2022
@prgeor
Copy link
Contributor

prgeor commented Nov 18, 2022

@stephenxs could you resolve merge conflicts?

@prgeor
Copy link
Contributor

prgeor commented Nov 18, 2022

@stephenxs Please populate these sections of the PR template:-

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

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
@stephenxs
Copy link
Collaborator Author

@stephenxs Please populate these sections of the PR template:-

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

Done

@stephenxs
Copy link
Collaborator Author

@stephenxs could you resolve merge conflicts?

Done by rebasing it.

@stephenxs
Copy link
Collaborator Author

psutest.txt
@prgeor a test log. all PSU test passed

@prgeor prgeor merged commit 72b9cf9 into sonic-net:master Nov 21, 2022
@stephenxs stephenxs deleted the psu-power-exceeding-threshold branch November 21, 2022 22:57
mdanish-kh pushed a commit to mdanish-kh/sonic-utilities that referenced this pull request Nov 23, 2022
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Dec 6, 2022
StormLiangMS pushed a commit to StormLiangMS/sonic-utilities that referenced this pull request Dec 11, 2022
StormLiangMS pushed a commit that referenced this pull request Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants