How do I get the power consumption of a Dell Poweredge server on the CLI?

How can I measure the power usage of a Dell Poweredge server from the command line interface?


Solution 1:

Install the srvadmin-all package and dependencies following these instructions: http://linux.dell.com/repo/hardware/latest/

You may need to log out and in to set the $PATH correctly.

Then:

[root@poweredge ~]# omreport chassis pwrmonitoring
Power Consumption Information

Power Consumption
Index             : 2
Status            : Ok
Probe Name        : System Board Pwr Consumption
Reading           : 126 W
Warning Threshold : 896 W
Failure Threshold : 980 W

Amperage
PS1 Current 1 : 0.6 A
PS2 Current 2 : 0.2 A

Power Headroom
System Instantaneous Headroom : 766 W
System Peak Headroom          : 549 W

Power Tracking Statistics
Statistic               : Energy Consumption
Measurement Start Time  : Wed Oct 17 20:18:51 2012
Measurement Finish Time : Fri Nov 13 09:51:52 2015
Reading                 : 3041.1 kWh

Statistic              : System Peak Power
Measurement Start Time : Wed Oct 17 20:18:51 2012
Peak Time              : Tue Jun  2 10:42:27 2015
Peak Reading           : 351 W

Statistic              : System Peak Amperage
Measurement Start Time : Wed Oct 17 20:18:51 2012
Peak Time              : Wed Aug  5 07:09:49 2015
Peak Reading           : 1024.2 A

Solution 2:

In my case omreport chassis pwrmonitoring was maybe not giving the result I wanted.

Tested in 2021 on Proxmox 7

Working way to get

racadm get system.Power.Realtime.Power
racadm get system.Power.Realtime.Power
56 W | 191 Btu/hr

More data

racadm get system.Power
#Avg.LastDay=58 W | 198 Btu/hr
#Avg.LastHour=58 W | 198 Btu/hr
#Avg.LastWeek=57 W | 195 Btu/hr
#EnergyConsumption=25.455 KWh | 86878 Btu
#EnergyConsumption.Clear=******** (Write-Only)
#EnergyConsumption.StarttimeStamp=Sat Jul 03 17:05:13 2021
HotSpare.Enable=Enabled
HotSpare.PrimaryPSU=PSU1
#Max.Amps=0.7 Amps
#Max.Amps.Timestamp=Sat Jul 17 23:40:46 2021
#Max.Headroom=731 W | 2495 Btu/hr
#Max.LastDay=99 W | 338 Btu/hr
#Max.LastDay.Timestamp=Thu Jul 22 23:35:53 2021
#Max.LastHour=86 W | 294 Btu/hr
#Max.LastHour.Timestamp=Fri Jul 23 19:20:05 2021
#Max.LastWeek=152 W | 519 Btu/hr
#Max.LastWeek.Timestamp=Sat Jul 17 23:41:23 2021
#Max.Power=169 W | 577 Btu/hr
#Max.Power.Timestamp=Mon Jul 19 05:02:47 2021
#Max.PowerClear=******** (Write-Only)
#Min.LastDay=54 W | 184 Btu/hr
#Min.LastDay.Timestamp=Thu Jul 22 20:24:57 2021
#Min.LastHour=54 W | 184 Btu/hr
#Min.LastHour.Timestamp=Fri Jul 23 19:00:05 2021
#Min.LastWeek=53 W | 181 Btu/hr
#Min.LastWeek.Timestamp=Fri Jul 16 19:57:31 2021
PFCEnable=Disabled
#Realtime.Amps=0.2 Amps
#Realtime.Headroom=837 W | 2857 Btu/hr
#Realtime.Power=63 W | 215 Btu/hr
#RedundancyCapabilities=Not Redundant,Input Power Redundant
RedundancyPolicy=Not Redundant

Deprecated way

racadm getconfig -g cfgServerPower
root@pve:~# racadm getconfig -g cfgServerPower
# cfgServerActualPowerConsumption=65 W | 222 Btu/hr
# cfgServerPeakPowerConsumption=169 W | 577 Btu/hr
# cfgServerPeakPowerConsumptionTimestamp=Mon Jul 19 05:02:47 2021
# cfgServerPowerConsumptionClear=******** (Write-Only)
# cfgServerPowerLastHourAvg=58 W | 198 Btu/hr
# cfgServerPowerLastDayAvg=58 W | 198 Btu/hr
# cfgServerPowerLastWeekAvg=57 W | 195 Btu/hr
# cfgServerPowerLastHourMinPower=54 W | 184 Btu/hr
# cfgServerPowerLastHourMinTime=Fri Jul 23 18:58:59 2021
# cfgServerPowerLastHourMaxPower=86 W | 294 Btu/hr
# cfgServerPowerLastHourMaxTime=Fri Jul 23 18:50:01 2021
# cfgServerPowerLastDayMinPower=54 W | 184 Btu/hr
# cfgServerPowerLastDayMinTime=Thu Jul 22 20:24:57 2021
# cfgServerPowerLastDayMaxPower=99 W | 338 Btu/hr
# cfgServerPowerLastDayMaxTime=Thu Jul 22 23:35:53 2021
# cfgServerPowerLastWeekMinPower=53 W | 181 Btu/hr
# cfgServerPowerLastWeekMinTime=Fri Jul 16 19:40:13 2021
# cfgServerPowerLastWeekMaxPower=152 W | 519 Btu/hr
# cfgServerPowerLastWeekMaxTime=Sat Jul 17 23:41:23 2021
# cfgServerPowerInstHeadroom=835 W | 2850 Btu/hr
# cfgServerPowerPeakHeadroom=731 W | 2495 Btu/hr
# cfgServerActualAmperageConsumption=0.2 Amps
# cfgServerPeakAmperage=0.7 Amps
# cfgServerPeakAmperageTimeStamp=Sat Jul 17 23:40:46 2021
# cfgServerCumulativePowerConsumption=25.443 KWh | 86837 Btu
# cfgServerCumulativePowerConsumptionTimeStamp=Sat Jul 03 17:05:13 2021
# cfgServerCumulativePowerClear=******** (Write-Only)


RAC1168: The RACADM "getconfig" command will be deprecated in a
future version of iDRAC firmware. Run the RACADM 
"racadm get" command to retrieve the iDRAC configuration parameters.
For more information on the get command, run the RACADM command
"racadm help get".