Linux/Power Report

From Omnia
Jump to navigation Jump to search

Power Reports

<markdown>

Ran terminal command: ``` echo "--- 1 ---"; ipmitool sensor get "PW Consumption" 2>/dev/null | grep -E "Sensor Reading|Sensor ID"; echo "--- 2 ---"; ipmitool dcmi power reading 2>/dev/null | grep Instantaneous; echo "--- 3 ---"; ipmitool sdr type "Power Supply" 2>/dev/null; echo "--- 4 ---"; nvme get-feature /dev/nvme0 -f 0x02 -H 2>/dev/null | grep "Power State"; echo "--- 5 ---"; nvme smart-log /dev/nvme0 2>/dev/null | grep -iE "^temperature|Warning Temperature Time|Critical Composite" ```

All verified. Here are the exact commands.

    1. Chassis power (BMC / IPMI)

```bash

  1. Current draw — single number

ipmitool sensor get "PW Consumption"

  1. Sensor Reading : 342 (+/- 0) Watts
  1. Current draw + historical min/max/avg over the sampling window

ipmitool dcmi power reading

  1. Instantaneous power reading: 342 Watts
  2. Minimum during sampling period: 144 Watts
  3. Maximum during sampling period: 580 Watts
  4. Average power reading: 211 Watts
  1. Is a power cap configured?

ipmitool dcmi power get_limit # → "not returned (80)" = unsupported here

  1. All voltage/power rails at once

ipmitool sdr elist full | grep -iE "watt|power|current|amp|volt" ```

    1. Power supply health

```bash

  1. PSU status — this is what found the failed PSU

ipmitool sdr type "Power Supply"

  1. PS1 Status | C0h | ok | 10.1 | Presence detected, Failure detected, Power Supply AC lost
  2. PS2 Status | C1h | ok | 10.2 | Presence detected
  1. Detail on one PSU

ipmitool sensor get "PS1 Status"

  1. Historical power events

ipmitool sel list | grep -iE "power|supply"

  1. Full event log minus login noise

ipmitool sel list | grep -viE "session audit" | tail -25 ```

    1. Drive power (NVMe — declared, not measured)

```bash

  1. Declared max power per power state

nvme id-ctrl /dev/nvme0 -H | grep -A2 "^ps "

  1. ps 0 : mp:25.00W idle_power:5.00W active_power:25.00W
  1. Which power state is currently active

nvme get-feature /dev/nvme0 -f 0x02 -H

  1. Power State (PS): 0

```

    1. Drive thermal / throttle proxies

Since watts aren't readable per-drive, these are the indicators that the drive hit its power limit:

```bash

  1. Live temps + throttle counters

nvme smart-log /dev/nvme0 | grep -iE "^temperature|Warning Temperature Time|Critical Composite|Temperature Sensor"

  1. Thresholds to compare against

nvme id-ctrl /dev/nvme0 | grep -iE "^wctemp|^cctemp" # 350K=77°C warn, 358K=85°C critical nvme get-feature /dev/nvme0 -f 0x04 -H # over-temp threshold ```

Current reading, 11 min into the run:

``` temperature  : 43 °C Warning Temperature Time  : 0 Critical Composite Temperature Time  : 0 Temperature Sensor 3  : 68 °C ```

Both throttle counters still zero, so the drive is not power/thermal limited.

    1. The continuous sampler

The script combining all of the above is at `smartmon.sh`, writing fsync'd rows every 10 s to `smart_monitor.csv`. The two power fields in it are:

```bash ipmitool dcmi power reading | awk '/Instantaneous/{print $4}' nvme get-feature /dev/nvme0 -f 0x02 | grep -oE 'Current value:[0-9a-fx]+' | cut -d: -f2 ```

Quick analysis of the collected data:

```bash

  1. Peak chassis watts observed

awk -F, 'NR>1 && $16+0>m {m=$16+0} END{print m" W"}' smart_monitor.csv

  1. Any row where a warning fired

awk -F, 'NR>1 && ($2!=0 || $8!=0 || $9!=0)' smart_monitor.csv ```

</markdown>