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

[Accton/PDDF] Support show cmd for psu-temp and fan #10215

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

jostar-yang
Copy link
Contributor

Why I did it

Support for show platform temp/fan for psu-temp and fan.
Original code doesn't has fan_drawer to support these information.

How I did it

Support for show platform temp/fan for psu-temp and fan.
Add fan_drawer.py and update thermal.py to add needed code.
It need PDDF common code to support . (Refer to #10213)

How to verify it

Test show platform temp and show platform fan.
root@as7726-32x-2:~# show platform fan
Drawer LED FAN Speed Direction Presence Status Timestamp


Fantray1 green Fantray1_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray1 green Fantray1_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray2 green Fantray2_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray2 green Fantray2_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray3 green Fantray3_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray3 green Fantray3_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray4 green Fantray4_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray4 green Fantray4_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray5 green Fantray5_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray5 green Fantray5_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray6 green Fantray6_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray6 green Fantray6_2 38% EXHAUST Present OK 20220311 08:13:04
N/A green PSU1_FAN1 23% EXHAUST Present OK 20220311 08:13:04
N/A green PSU2_FAN1 22% EXHAUST Present OK 20220311 08:13:04
root@as7726-32x-2:~# show platform temp
Sensor Temperature High TH Low TH Crit High TH Crit Low TH Warning Timestamp


PSU1_TEMP1 28 N/A N/A N/A N/A False 20220311 08:13:04
PSU2_TEMP1 25 N/A N/A N/A N/A False 20220311 08:13:04
TEMP1 23.5 80.0 N/A N/A N/A False 20220311 08:13:04
TEMP2 27 80.0 N/A N/A N/A False 20220311 08:13:04
TEMP3 24 80.0 N/A N/A N/A False 20220311 08:13:04
TEMP4 27 80.0 N/A N/A N/A False 20220311 08:13:04
TEMP5 24 80.0 N/A N/A N/A False 20220311 08:13:04

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@FuzailBrcm
Copy link
Contributor

@jostar-yang
How about enabling the thermalctld in pmon_daemon_control.json files? That is required for all these platforms and 'show platform fan' and 'show platform temperature' would work only afterwards.

@jostar-yang
Copy link
Contributor Author

@jostar-yang How about enabling the thermalctld in pmon_daemon_control.json files? That is required for all these platforms and 'show platform fan' and 'show platform temperature' would work only afterwards.

@jostar-yang jostar-yang reopened this Mar 14, 2022
@jostar-yang
Copy link
Contributor Author

Human error to close the PR

@jostar-yang
Copy link
Contributor Author

Below PR is that enable the thermalctld in pmon_daemon_control.json files
https://github.com/Azure/sonic-buildimage/pull/9982/files

@lguohan lguohan merged commit ab3053b into sonic-net:master Mar 29, 2022
@AStrangwood
Copy link

I have built the latest master with these changes and these commands and more still dont work. any chance i did something wrong?

admin@switch01:~$ show platform fan
Fan Not detected
admin@switch01:~$ show platform psustatus
Error: Failed to get the number of PSUs
Error: Failed to get PSU status
Error: failed to get PSU status from state DB
admin@dpn-switch01:~$ sudo show system-health summary
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/show/system_health.py", line 21, in summary
    if os.environ["UTILITIES_UNIT_TESTING"] == "1":
  File "/usr/lib/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'UTILITIES_UNIT_TESTING'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/show", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/show/system_health.py", line 34, in summary
    from sonic_platform.chassis import Chassis
ModuleNotFoundError: No module named 'sonic_platform'

Platform: x86_64-accton_as7726_32x-r0
HwSKU: Accton-AS7726-32X
ASIC: broadcom
ASIC Count: 1
Serial Number: N/A
Model Number: N/A
Hardware Revision: N/A
Uptime: 00:31:48 up 46 min, 1 user, load average: 0.30, 0.49, 0.46
Date: Mon 21 Mar 2022 00:31:48

@FuzailBrcm
Copy link
Contributor

@AStrangwood
I tested with the following build (85509) just now,
https://sonic-build.azurewebsites.net/ui/sonic/pipelines/138/builds/85509/artifacts?branchName=master
and everything looks fine.

root@sonic:/home/admin# show ver

SONiC Software Version: SONiC.master.85509-ced22db1e
Distribution: Debian 11.3
Kernel: 5.10.0-8-2-amd64
Build commit: ced22db1e
Build date: Wed Mar 30 21:19:17 UTC 2022
Built by: AzDevOps@sonic-build-workers-001B95

Platform: x86_64-accton_as7726_32x-r0
HwSKU: Accton-AS7726-32X
ASIC: broadcom
ASIC Count: 1
Serial Number: N/A
Model Number: FP3ZZ7632074A
Hardware Revision: N/A
Uptime: 04:27:07 up 2 min,  1 user,  load average: 1.83, 1.07, 0.43

Docker images:
REPOSITORY                    TAG                      IMAGE ID       SIZE
docker-syncd-brcm             latest                   5d8686f8c794   784MB
docker-syncd-brcm             master.85509-ced22db1e   5d8686f8c794   784MB
docker-gbsyncd-credo          latest                   b1ec8e6a6c98   422MB
docker-gbsyncd-credo          master.85509-ced22db1e   b1ec8e6a6c98   422MB
docker-dhcp-relay             latest                   e16135c0962f   427MB
docker-sonic-telemetry        latest                   cfb9f73f99f6   505MB
docker-sonic-telemetry        master.85509-ced22db1e   cfb9f73f99f6   505MB
docker-database               latest                   68044cc3b3c2   417MB
docker-database               master.85509-ced22db1e   68044cc3b3c2   417MB
docker-teamd                  latest                   80afa89cd98e   420MB
docker-teamd                  master.85509-ced22db1e   80afa89cd98e   420MB
docker-sflow                  latest                   32b9ab301483   421MB
docker-sflow                  master.85509-ced22db1e   32b9ab301483   421MB
docker-orchagent              latest                   6a548a542781   436MB
docker-orchagent              master.85509-ced22db1e   6a548a542781   436MB
docker-macsec                 latest                   df34b9b2cff2   423MB
docker-macsec                 master.85509-ced22db1e   df34b9b2cff2   423MB
docker-fpm-frr                latest                   8caa79d552f9   438MB
docker-fpm-frr                master.85509-ced22db1e   8caa79d552f9   438MB
docker-nat                    latest                   c7b008415a9b   423MB
docker-nat                    master.85509-ced22db1e   c7b008415a9b   423MB
docker-platform-monitor       latest                   656b3fa1ee9e   519MB
docker-platform-monitor       master.85509-ced22db1e   656b3fa1ee9e   519MB
docker-sonic-mgmt-framework   latest                   be13fdaedfce   549MB
docker-sonic-mgmt-framework   master.85509-ced22db1e   be13fdaedfce   549MB
docker-snmp                   latest                   15bc540d248d   449MB
docker-snmp                   master.85509-ced22db1e   15bc540d248d   449MB
docker-router-advertiser      latest                   2e5b80beb71e   405MB
docker-router-advertiser      master.85509-ced22db1e   2e5b80beb71e   405MB
docker-lldp                   latest                   c87c6ce88ca1   445MB
docker-lldp                   master.85509-ced22db1e   c87c6ce88ca1   445MB
docker-mux                    latest                   cb50b42f8eea   458MB
docker-mux                    master.85509-ced22db1e   cb50b42f8eea   458MB

root@sonic:/home/admin#
root@sonic:/home/admin# show platform fan
  Drawer    LED         FAN    Speed    Direction    Presence    Status          Timestamp
--------  -----  ----------  -------  -----------  ----------  --------  -----------------
Fantray1  green  Fantray1_1      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray1  green  Fantray1_2      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray2  green  Fantray2_1      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray2  green  Fantray2_2      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray3  green  Fantray3_1      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray3  green  Fantray3_2      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray4  green  Fantray4_1      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray4  green  Fantray4_2      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray5  green  Fantray5_1      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray5  green  Fantray5_2      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray6  green  Fantray6_1      38%      EXHAUST     Present        OK  20220331 04:25:43
Fantray6  green  Fantray6_2      38%      EXHAUST     Present        OK  20220331 04:25:43
     N/A    off   PSU1_FAN1       0%                  Present        OK  20220331 04:25:43
     N/A  green   PSU2_FAN1      23%      EXHAUST     Present        OK  20220331 04:25:44
root@sonic:/home/admin# show platform psustatus
PSU    Model     Serial              HW Rev      Voltage (V)    Current (A)    Power (W)  Status    LED
-----  --------  ------------------  --------  -------------  -------------  -----------  --------  -----
PSU 1  N/A       N/A                 N/A                0.00           0.00         0.00  NOT OK    off
PSU 2  YM-2651Y  SA070V581905000496  N/A               12.17          11.09       134.00  OK        green
root@sonic:/home/admin#
root@sonic:/home/admin# show platform temperature
    Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
----------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
PSU1_TEMP1            0          N/A       N/A             N/A            N/A      False  20220331 04:25:43
PSU2_TEMP1           37          N/A       N/A             N/A            N/A      False  20220331 04:25:43
     TEMP1           32.5       80.0       N/A             N/A            N/A      False  20220331 04:25:43
     TEMP2           34         80.0       N/A             N/A            N/A      False  20220331 04:25:43
     TEMP3           32         80.0       N/A             N/A            N/A      False  20220331 04:25:43
     TEMP4           34         80.0       N/A             N/A            N/A      False  20220331 04:25:43
     TEMP5           34.5       80.0       N/A             N/A            N/A      False  20220331 04:25:43
root@sonic:/home/admin#
root@sonic:/home/admin# show interfaces transceiver  presence
Port         Presence
-----------  -----------
Ethernet0    Present
Ethernet4    Present
Ethernet8    Present
Ethernet12   Not present
Ethernet16   Present
Ethernet20   Not present
Ethernet24   Not present
Ethernet28   Not present
Ethernet32   Present
Ethernet36   Present
Ethernet40   Present
Ethernet44   Not present
Ethernet48   Not present
Ethernet52   Not present
Ethernet56   Present
Ethernet60   Not present
Ethernet64   Not present
Ethernet68   Not present
Ethernet72   Not present
Ethernet76   Not present
Ethernet80   Not present
Ethernet84   Not present
Ethernet88   Not present
Ethernet92   Not present
Ethernet96   Not present
Ethernet100  Present
Ethernet104  Not present
Ethernet108  Not present
Ethernet112  Not present
Ethernet116  Not present
Ethernet120  Not present
Ethernet124  Not present
root@sonic:/home/admin#
root@sonic:/home/admin# show interfaces  transceiver eeprom
Ethernet0: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: 256B/257B (transcoded FEC-enabled data)
        Extended Identifier: Power Class 4 Module (3.5W max.), No CLEI code present in Page 02h, CDR present in TX, CDR present in RX
        Extended RateSelect Compliance: Unknown
        Identifier: QSFP28 or later
        Length Cable Assembly(m): 10.0
        Nominal Bit Rate(100Mbs): 255
        Specification compliance:
                10/40G Ethernet Compliance Code: Extended
                Extended Specification Compliance: 100G AOC (Active Optical Cable) or 25GAUI C2M AOC
                Fibre Channel Link Length: Unknown
                Fibre Channel Speed: Unknown
                Fibre Channel Transmission Media: Unknown
                Fibre Channel Transmitter Technology: Unknown
                Gigabit Ethernet Compliant Codes: Unknown
                SAS/SATA Compliance Codes: Unknown
                SONET Compliance Codes: Unknown
        Vendor Date Code(YYYY-MM-DD Lot): 2016-09-02
        Vendor Name: BROCADE
        Vendor OUI: 00-05-1e
        Vendor PN: 57-1000347-01
        Vendor Rev: A
        Vendor SN: YEF11636WWA00XQB
..
..
root@sonic:/home/admin#

I have done a fresh clone and building it now. Will test with the built image later.

How did you build your image? Was a fresh clone and build, or just incremental build?

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.

None yet

4 participants