Skip to content

Instantly share code, notes, and snippets.

@zzzoom
Last active August 29, 2015 14:24
Show Gist options
  • Save zzzoom/33b560a8687ab6df0454 to your computer and use it in GitHub Desktop.
Save zzzoom/33b560a8687ab6df0454 to your computer and use it in GitHub Desktop.
Ganglia gmetric script that sends the maximum coretemp value
#!/bin/bash
GMETRIC=gmetric
GMETRIC_OPTS=""
# check that coretemp is loaded
module=`lsmod | awk '{print $1}' | grep coretemp`
if [ -z "$module" ]; then
exit
fi
# send cpu temps if gmond is running
service gmond status &> /dev/null
if [ $? -eq 0 ]; then
$GMETRIC $GMETRIC_OPTS --type="float" --group="temp" --name="core_max_temp" --units="Celsius" --value=`sensors -u 'coretemp-isa-*' | grep input | awk '{print $2}' | sort -nr | head -1`
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment