Last active
May 10, 2018 12:56
-
-
Save Jacketbg/6973efdb41a2ecfcf2a83ea84c086887 to your computer and use it in GitHub Desktop.
Collect power monitoring data from various vendors and pump it to Graphite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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