Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
    • APC Back-UPS ES 700G
    • ARM
    • AVM
    • AX88772A Fast Ethernet USB Adapter
    • AXIS M1144-L
    • Adaptec RAID controller
    • Android
    • Archive
    • Arduino
    • Bionx
    • Bluetooth
    • Brother
    • Cisco
    • DCPMM / NVRAM
    • Dell
    • ESP32 / ESP8266
    • HP (Hewlett Packard)
    • IPMI
      • Get server(s) power consumption
    • Intel NVMe
    • LSI MegaRAID
    • Lenovo ThinkPad
    • Linpack
    • Linux Benchmark
    • Logitech Squeezebox Touch
    • Logitech
    • Mellanox
    • Micron
    • NVMe
    • OpenWRT
    • RaLink RT2500
    • Raspberry Pi
    • SmartHome
    • Snom 320 / 370
    • Solar
    • Sony KDL-55EX725
    • Supermicro
    • Surface
    • TEMPer (usb temperatur)
    • USB Serial adapter
    • Ubiquiti
    • Update Intel NIC firmware
    • Yamaha
    • ZyXEL NSA320
    • ahoy DTU
    • batteries
    • hdparm
    • iDRAC
    • memtest86+
    • smartmontools
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid
  • hardware
  • redfish
  • ipmi

bmc_credentials.conf

export BMC_USER=ADMIN
export BMC_PASS=ADMIN

get-power-consumption.sh

#!/bin/bash

# source BMC credentials
. $(dirname "${BASH_SOURCE[0]}")/bmc_credentials.conf

if [ $# -eq 1 ]; then
    BMC_NODES="${1}"
else
    echo "Usage: $0 \"\""
    echo "e.g $0 \"10.0.0.1 \$(echo 10.0.2.{10..20})\""
    exit
fi

printf "%-40s %-10s %-10s\n" "Server" "Current" "AVG"
for BMC_NODE in ${BMC_NODES}; do
    POWER_CONSUMPTION=$(curl --connect-timeout 3 -s https://${BMC_NODE}/redfish/v1/Chassis/1/Power/ -k -u ${BMC_USER}:${BMC_PASS} | jq -r ".PowerControl[].PowerConsumedWatts")
    [ -z ${POWER_CONSUMPTION} ] && POWER_CONSUMPTION=$(ipmitool -I lanplus -H ${BMC_NODE} -U ${BMC_USER} -P ${BMC_PASS} dcmi power reading | awk '/Instantaneous/ {print $(NF-1)}')

    POWER_CONSUMPTION_AVG=$(curl --connect-timeout 3 -s https://${BMC_NODE}/redfish/v1/Chassis/1/Power/ -k -u ${BMC_USER}:${BMC_PASS} | jq -r ".PowerControl[].PowerMetrics.AverageConsumedWatts")
    [ -z ${POWER_CONSUMPTION_AVG} ] && POWER_CONSUMPTION_AVG=$(ipmitool -I lanplus -H ${BMC_NODE} -U ${BMC_USER} -P ${BMC_PASS} dcmi power reading | awk '/Average/ {print $(NF-1)}')

    printf "%-40s %-10s %-10s\n" "${BMC_NODE}" "${POWER_CONSUMPTION}" "${POWER_CONSUMPTION_AVG}"
done

define server (BMC) list

BMC_NODES="
10.0.0.222
$(echo www{1..9}.example.com)
$(echo 10.0.1.{101..201})
"

Get data from redfish / ipmi

./bin/get-power-consumption.sh "${BMC_NODES}"

Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung