##################### Test Script ################################# root@sonic:/home/admin# cat psu_test.py from sonic_platform.chassis import Chassis chas = Chassis() for psu in chas.get_all_psus(): print "PSU Name:",psu.get_name() print "\tPresence:",psu.get_presence() print "\tStatus:",psu.get_status() print "\tPowergood Status:",psu.get_powergood_status() print "\tSerial No:",psu.get_serial() print "\tPart No:",psu.get_model() print "\tVoltage:",psu.get_voltage(),"V" print "\tCurrent:",psu.get_current(),"A" print "\tPower:",psu.get_power(),"W" for fan in psu.get_all_fans(): print "\tFan Name:",fan.get_name() print "\tFan Presence:",fan.get_presence() root@sonic:/home/admin# ####################### Both PSUs present and powered on ##################### root@sonic:/home/admin# python psu_test.py PSU Name: PSU1 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02JZ-A00 Part No: 02RPHX Voltage: 12.21 V Current: 0.607 A Power: 60.7 W Fan Name: PSU1 Fan Fan Presence: True PSU Name: PSU2 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02IW-A00 Part No: 02RPHX Voltage: 12.19 V Current: 0.617 A Power: 75.2 W Fan Name: PSU2 Fan Fan Presence: True root@sonic:/home/admin# ####################### PSU1 powered off ##################### root@sonic:/home/admin# root@sonic:/home/admin# python psu_test.py PSU Name: PSU1 Presence: True Status: False Powergood Status: False Serial No: CN-02RPHX-DED00-788-02JZ-A00 Part No: 02RPHX Voltage: 0.0 V Current: 0.0 A Power: 0.0 W Fan Name: PSU1 Fan Fan Presence: True PSU Name: PSU2 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02IW-A00 Part No: 02RPHX Voltage: 12.19 V Current: 1.117 A Power: 136.2 W Fan Name: PSU2 Fan Fan Presence: True root@sonic:/home/admin# root@sonic:/home/admin# root@sonic:/home/admin# ####################### PSU1 removed ##################### root@sonic:/home/admin# root@sonic:/home/admin# python psu_test.py PSU Name: PSU1 Presence: False Status: False Powergood Status: False Serial No: NA Part No: NA Voltage: 0.0 V Current: 0.0 A Power: 0.0 W Fan Name: PSU1 Fan Fan Presence: False PSU Name: PSU2 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02IW-A00 Part No: 02RPHX Voltage: 12.21 V Current: 1.109 A Power: 135.2 W Fan Name: PSU2 Fan Fan Presence: True root@sonic:/home/admin# ####################### PSU1 inserted ##################### root@sonic:/home/admin# root@sonic:/home/admin# python psu_test.py PSU Name: PSU1 Presence: True Status: False Powergood Status: False Serial No: CN-02RPHX-DED00-788-02JZ-A00 Part No: 02RPHX Voltage: 0.0 V Current: 0.0 A Power: 0.0 W Fan Name: PSU1 Fan Fan Presence: True PSU Name: PSU2 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02IW-A00 Part No: 02RPHX Voltage: 12.19 V Current: 1.106 A Power: 135.2 W Fan Name: PSU2 Fan Fan Presence: True root@sonic:/home/admin# root@sonic:/home/admin# ####################### PSU1 powered on #################### root@sonic:/home/admin# root@sonic:/home/admin# python psu_test.py PSU Name: PSU1 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02JZ-A00 Part No: 02RPHX Voltage: 12.21 V Current: 0.604 A Power: 60.4 W Fan Name: PSU1 Fan Fan Presence: True PSU Name: PSU2 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02IW-A00 Part No: 02RPHX Voltage: 12.19 V Current: 0.625 A Power: 76.1 W Fan Name: PSU2 Fan Fan Presence: True root@sonic:/home/admin# ####################### PSU2 powered off ##################### root@sonic:/home/admin# root@sonic:/home/admin# python psu_test.py PSU Name: PSU1 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02JZ-A00 Part No: 02RPHX Voltage: 12.19 V Current: 1.36 A Power: 136.0 W Fan Name: PSU1 Fan Fan Presence: True PSU Name: PSU2 Presence: True Status: False Powergood Status: False Serial No: CN-02RPHX-DED00-788-02IW-A00 Part No: 02RPHX Voltage: 0.0 V Current: 0.0 A Power: 0.0 W Fan Name: PSU2 Fan Fan Presence: True root@sonic:/home/admin# root@sonic:/home/admin# ####################### PSU2 removed ##################### root@sonic:/home/admin# root@sonic:/home/admin# python psu_test.py PSU Name: PSU1 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02JZ-A00 Part No: 02RPHX Voltage: 12.19 V Current: 1.367 A Power: 136.7 W Fan Name: PSU1 Fan Fan Presence: True PSU Name: PSU2 Presence: False Status: False Powergood Status: False Serial No: NA Part No: NA Voltage: 0.0 V Current: 0.0 A Power: 0.0 W Fan Name: PSU2 Fan Fan Presence: False root@sonic:/home/admin# ####################### PSU2 Inserted ##################### root@sonic:/home/admin# root@sonic:/home/admin# python psu_test.py PSU Name: PSU1 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02JZ-A00 Part No: 02RPHX Voltage: 12.21 V Current: 1.355 A Power: 135.5 W Fan Name: PSU1 Fan Fan Presence: True PSU Name: PSU2 Presence: True Status: False Powergood Status: False Serial No: CN-02RPHX-DED00-788-02IW-A00 Part No: 02RPHX Voltage: 0.0 V Current: 0.0 A Power: 0.0 W Fan Name: PSU2 Fan Fan Presence: True root@sonic:/home/admin# ####################### PSU2 powered on ##################### root@sonic:/home/admin# python psu_test.py PSU Name: PSU1 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02JZ-A00 Part No: 02RPHX Voltage: 12.21 V Current: 0.6 A Power: 60.0 W Fan Name: PSU1 Fan Fan Presence: True PSU Name: PSU2 Presence: True Status: True Powergood Status: True Serial No: CN-02RPHX-DED00-788-02IW-A00 Part No: 02RPHX Voltage: 12.19 V Current: 0.627 A Power: 76.5 W Fan Name: PSU2 Fan Fan Presence: True root@sonic:/home/admin# root@sonic:/home/admin#