Skip to content

Instantly share code, notes, and snippets.

@zzzoom
Created July 4, 2015 08:42
Show Gist options
  • Save zzzoom/3f3cad6fdabed187eb29 to your computer and use it in GitHub Desktop.
Save zzzoom/3f3cad6fdabed187eb29 to your computer and use it in GitHub Desktop.
Ganglia gmetric that sends the system temperature (read from IPMI)
#!/bin/bash
GMETRIC=gmetric
GMETRIC_OPTS=""
# TODO: check ipmi modules?
# send cpu temps if gmond is running
service gmond status &> /dev/null
if [ $? -eq 0 ]; then
$GMETRIC $GMETRIC_OPTS --type="int32" --group="temp" --name="system_temp" --units="Celsius" --value=`ipmitool sdr 2>/dev/null | grep 'Sys.* Temp' | cut -d'|' -f2 | awk '{print $1}'`
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment