Skip to content

Instantly share code, notes, and snippets.

@Jacketbg
Last active May 10, 2018 12:56
Show Gist options
  • Save Jacketbg/6973efdb41a2ecfcf2a83ea84c086887 to your computer and use it in GitHub Desktop.
Save Jacketbg/6973efdb41a2ecfcf2a83ea84c086887 to your computer and use it in GitHub Desktop.
Collect power monitoring data from various vendors and pump it to Graphite
#!/bin/bash
PORT=2003
SERVER=192.168.55.55
# Uncomment the line below for Supermicro IPMIs (ftp://ftp.supermicro.com/utility/IPMICFG)
WATT=$( ipmicfg -nm oemgetpower | awk '{print $1}' )
# Uncomment the line below for HP iLO (yum install freeipmi.x86_64)
#WATT=$( ipmi-dcmi --get-system-power-statistics | grep 'Current Power' | awk '{print $4}' )
# Uncomment and edit the line below to send static usage data (if you don't have a power monitor)
#WATT=160
echo "ipmi-stats.cluster.`hostname -s`.power ${WATT} `date +%s`" | nc ${SERVER} ${PORT}
echo -e WATT=$WATT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment