Skip to content

Instantly share code, notes, and snippets.

@shortcord
Last active September 30, 2019 06:22
Show Gist options
  • Save shortcord/8fa78c24377cf4a2b27cb746ad6199eb to your computer and use it in GitHub Desktop.
Save shortcord/8fa78c24377cf4a2b27cb746ad6199eb to your computer and use it in GitHub Desktop.
Dirty script. Grabs the power consumption average from IPMI, shoves it through JQ and gives back an array of objects prefixed by the measurement label.
!#/bin/sh
ipmi-oem dell get-power-consumption-statistics average | awk -F":" '{gsub (" ", "", $0); print}' | jq --slurp --compact-output --raw-input 'split("\n") | map(select(. !="") | split(":") | { (.[0]): (.[1]) })'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment