Skip to content

pddf fanutil improvments#4637

Draft
caleb-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:pddf-fanutil-improvments
Draft

pddf fanutil improvments#4637
caleb-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:pddf-fanutil-improvments

Conversation

@caleb-nexthop

@caleb-nexthop caleb-nexthop commented Jun 22, 2026

Copy link
Copy Markdown

What I did

Improved fan CLI output so unpopulated fan slots no longer report misleading values. Absent fans now show N/A, and pddf_fanutil getspeed also shows duty cycle.

How I did it

Used the existing PSU power-good/output status and combined it with presence and input-voltage information to classify PSUs more accurately. Shared that classification between psushow and fanshow so absent, unpowered, faulted, and healthy PSUs are displayed consistently.

How to verify it

Run sudo pddf_fanutil getspeed and confirm unpopulated fans show N/A instead of 0 or stray RPM values. Run show platform fan and confirm absent fans show Not Present / Not Installed with N/A for non-applicable fields.

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

sudo pddf_fanutil getspeed would not show DUTY Cycle. This could be confusing as setspeed uses duty cycle.

Also, show plat fan would display speeds and details for an uninstalled fan that is not relevant.
Also not installed fans would display NOT OK - similar to if there was a fault.

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

admin@sonic:~$ sudo pddf_fanutil getspeed
FAN           SPEED (RPM)    DUTY CYCLE (%)
----------  -------------  ----------------
Fantray1_1           6093                30
Fantray1_2           5199                30
Fantray2_1           6093                30
Fantray2_2           5227                30
Fantray3_1           6112                30
Fantray3_2           5270                30
Fantray4_1           6093                30
Fantray4_2           5213                30
Fantray5_1            233                30
Fantray5_2              0                30
Fantray6_1            233                30
Fantray6_2              0                30
Fantray7_1           6132                30
Fantray7_2           5213                30
Fantray8_1            233                30
Fantray8_2              0                30
admin@sonic:~$ show plat fan
  Drawer    LED         FAN    Speed    Direction     Presence         Status          Timestamp
--------  -----  ----------  -------  -----------  -----------  -------------  -----------------
Fantray1  green  Fantray1_1      30%      exhaust      Present             OK  20250903 19:08:42
Fantray1  green  Fantray1_2      30%      exhaust      Present             OK  20250903 19:08:42
Fantray2  green  Fantray2_1      30%      exhaust      Present             OK  20250903 19:08:42
Fantray2  green  Fantray2_2      30%      exhaust      Present             OK  20250903 19:08:42
Fantray3  green  Fantray3_1      30%      exhaust      Present             OK  20250903 19:08:42
Fantray3  green  Fantray3_2      30%      exhaust      Present             OK  20250903 19:08:42
Fantray4  green  Fantray4_1      30%      exhaust      Present             OK  20250903 19:08:42
Fantray4  green  Fantray4_2      30%      exhaust      Present             OK  20250903 19:08:42
Fantray5    red  Fantray5_1      N/A          N/A  Not Present  Not Installed  20250903 19:08:42
Fantray5    red  Fantray5_2      N/A          N/A  Not Present  Not Installed  20250903 19:08:42
Fantray6    red  Fantray6_1      N/A          N/A  Not Present  Not Installed  20250903 19:08:42
Fantray6    red  Fantray6_2      N/A          N/A  Not Present  Not Installed  20250903 19:08:42
Fantray7  green  Fantray7_1      30%      exhaust      Present             OK  20250903 19:08:42
Fantray7  green  Fantray7_2      30%      exhaust      Present             OK  20250903 19:08:42
Fantray8    red  Fantray8_1      N/A          N/A  Not Present  Not Installed  20250903 19:08:42
Fantray8    red  Fantray8_2      N/A          N/A  Not Present  Not Installed  20250903 19:08:42
     N/A    N/A   PSU1_FAN1      N/A          N/A  Not Present  Not Installed  20250903 19:08:42
     N/A    N/A   PSU2_FAN1      N/A          N/A  Not Present  Not Installed  20250903 19:08:42
     N/A    N/A   PSU3_FAN1      N/A          N/A  Not Present  Not Installed  20250903 19:08:42
     N/A    N/A   PSU4_FAN1      N/A          N/A  Not Present  Not Installed  20250903 19:08:42


Signed-off-by: Caleb <caleb@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks!

---Powered by SONiC BuildBot

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.

2 participants