Last active
August 29, 2015 14:24
-
-
Save zzzoom/33b560a8687ab6df0454 to your computer and use it in GitHub Desktop.
Ganglia gmetric script that sends the maximum coretemp value
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 | |
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