AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
Expand all | Collapse all

IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

  • 1.  IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

    Posted Sun February 08, 2026 02:01 AM

    I would like to share a useful IBM HMC REST-based Python script that retrieves real-time Power Supply and Fan hardware inventory and health status across managed systems. This has been successfully tested and validated on enterprise-grade Power10 (P10) systems.

    This script provides:

    • Power Supply FRU number, serial number, state, and health

    • Fan status and redundancy visibility

    • System-level hardware inventory via REST API

    Key Benefits for Our Operations

    This is especially valuable for:

    • Power switching and PSU failover testing

    • ✅ Verifying active/standby PSU behavior during maintenance

    • ✅ Confirming hardware redundancy and health before and after activities

    • ✅ Proactive detection of degraded or failed components

    Location FruNum SerialNum State Health Description MemberId

    U78D8.ND0.FGD05QQ-E1 03KP586 YL10KF493341 Enabled OK Modular PowerSupply 1000

    U78D8.ND0.FGD05QQ-E2 03KP586 YL10KF493575 Enabled OK Modular PowerSupply 1001

    This approach gives us better validation evidence during PS testing compared to manual HMC checks and can be easily automated or integrated into pre/post maintenance workflows.

    Note: Verified on RHEL8.X(8.10) and RHEL9.X(9.7) from python (3.6-3.9) working fine



    ------------------------------
    Abbas Meeran
    ------------------------------

    Attachment(s)

    py
    hmc_hw.py   13 KB 1 version


  • 2.  RE: IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

    Posted Sun February 08, 2026 07:01 AM

    Hello Abbas

    really great job you did and i think it is very useful !!!!!! what do i need to run this phyton ??? Do i need a list of HMC scanning for Fans etc ?  I have a Power 11 if you want we can workout together to extend your python to P11 !!???  Again...great job my friend !

    thx a lot

    vince



    ------------------------------
    Vincencio Michaelis
    Senior Expert
    Bosch
    Stuttgart
    +4915119154774
    ------------------------------



  • 3.  RE: IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

    Posted Sun February 08, 2026 07:13 AM

    Thanks for your feedback

    python3.6 hmc_hw.py -i  hmcip -u hscroot -s frame-server -p ( i didnt tried on power11, please check and share the feedback please)



    ------------------------------
    Abbas Meeran
    ------------------------------



  • 4.  RE: IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

    Posted Sun February 08, 2026 07:20 AM

    i have a list of HMC.....so can i scan all HMC in a loop ? What is  -i hmcimp   ???? I want simply call your script with HMC names because keys for hscroot are exchanged 



    ------------------------------
    Vincencio Michaelis
    Senior Expert
    Bosch
    Stuttgart
    +4915119154774
    ------------------------------



  • 5.  RE: IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

    Posted Sun February 08, 2026 07:29 AM

    while read hmc frame; do
      python3.10 hmc_hw.py -i "$hmc" -u hscroot -s "$frame" -p
    done < hmc_frame_list.txt 

    I think we can use some for loop to get all details but my end having limited edition



    ------------------------------
    Abbas Meeran
    ------------------------------



  • 6.  RE: IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

    Posted Tue February 24, 2026 03:23 PM

    root@rb3zf01(Si):/cpt/vince $ python3.12 /cpt/vince/hmc_hw.py -i <HMC-NAME>  -u hscroot
    Traceback (most recent call last):
      File "/cpt/vince/hmc_hw.py", line 41, in <module>
        import requests
    ModuleNotFoundError: No module named 'requests'

    Hello Vincencio,

    thanks for sharing the script.

    I believe the issue is simply that the script is written for:

    #!/usr/bin/python3.6

    but you're running it with Python 3.12. The requests module is therefore missing in the 3.12 environment.

    You can either:

    • Run it with Python 3.6 (if available):

    /usr/bin/python3.6 hmc_hw.py -i <HMC-NAME> -u hscroot -p

    or

    • Install the required modules for Python 3.12:

    python3.12 -m pip install requests lxml

    Note that lxml is also required and the script will fail without it.

    Unfortunately I don't have access to a Power11 system, so testing in that environment is a bit difficult on my side - I'm relying on your feedback there.

    Let me know how it goes.

    Best regards,
    Abbas



    ------------------------------
    Abbas Meeran
    ------------------------------



  • 7.  RE: IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

    Posted Sun February 08, 2026 07:23 AM

    hi

    can you also add in the output the fan speed in Rpm for each Fan ? 



    ------------------------------
    Vincencio Michaelis
    Senior Expert
    Bosch
    Stuttgart
    +4915119154774
    ------------------------------



  • 8.  RE: IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

    Posted Wed April 08, 2026 10:00 PM
    Edited by Chris Gibson Wed April 08, 2026 10:00 PM

    All thanks go to IBMer Dominic Lancaster. He is the author of this script. You can find it here: https://www.ibm.com/support/pages/node/7182675 and here https://www.ibm.com/support/pages/system/files/inline-files/hmc_hwi.py__0.txt. He first mentioned it here https://community.ibm.com/community/user/discussion/where-to-find-power-supply-status-hardware-sensor-data.

    $ more hmc_hwi.py__0.txt
    #!/usr/bin/python3.6

    #
    # IBM Disclaimer
    #
    # IBM grants you a nonexclusive copyright license to use all programming code examples from which you can generate similar
    # function tailored to your own specific needs.
    # SUBJECT TO ANY STATUTORY WARRANTIES WHICH CANNOT BE EXCLUDED, IBM, ITS PROGRAM DEVELOPERS AND SUPPLIERS MAKE NO
    # WARRANTIES OR CONDITIONS EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OR CONDITIONS
    # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT, REGARDING THE PROGRAM OR TECHNICAL SUPPORT, IF ANY.
    #
    # UNDER NO CIRCUMSTANCES IS IBM, ITS PROGRAM DEVELOPERS OR SUPPLIERS LIABLE FOR ANY OF THE FOLLOWING, EVEN IF INFORMED OF THEIR POSSIBILITY:
    #
    # 1. LOSS OF, OR DAMAGE TO, DATA;
    # 2. DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES, OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES; OR
    # 3. LOST PROFITS, BUSINESS, REVENUE, GOODWILL, OR ANTICIPATED SAVINGS.
    #
    # SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF DIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, SO SOME OR ALL
    # OF THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU.
    #
    # All due acknowledgments to the IBM team who wrote ansible.ibm_power.hmc
    # much of this code is re-used
    #

    # all due acknowledments to the IBM team who wrote ansible.ibm_power.hmc
    # much of this code is re-used
    # because I hope to turn this into ansilibic module/extention of ansible.ibm_power.hmc
    #
    # Who          Ver   What
    # D Lancaster  v1.0  allows you to get PS and FAN status for all systems
    #                    -i hmc        or hmc,hmc2     eg a list of hmcs
    #                    -s sysnames   or sysname1,sysname2 a list of systems to look at (else all is implied)


    from __future__ import absolute_import, division, print_function



    ------------------------------
    Chris Gibson
    ------------------------------



  • 9.  RE: IBM HMC Script for Power Supply & Fan Status – Validated on Power10 Enterprise Systems

    Posted 29 days ago

    Hi Abbas,

    I saw your post and set up the script on one of our Ubuntu Linux servers. It works great on servers where there are no problems, however, I tried running the script against a server where I know there is a cooling / power problem and I get the following error message.

    Do you know who I can contact to resolve this problem?

    ---------------

    Stuart Lane

    AIX Support 

    Nedbank 

    South Africa

    --------------



    ------------------------------
    Nedbank Power Systems Support
    ------------------------------