Compare commits

...

7 Commits
v1.1 ... master

3 changed files with 39 additions and 5 deletions

21
README Normal file
View File

@ -0,0 +1,21 @@
ABOUT
check_gputemp is a Nagios plugin which checks the GPU temperature of ATI based
graphics card. It uses the aticonfig tool from ATI's proprietary driver fglrx.
This script checks the GPU temperature of ATI based graphics card using the
aticonfig tool from their proprietary driver fglrx. The script is written in
Bash and complies with the Nagios development guidelines. For example it uses
the -w, -c and -v arguments, has some basic sanity checks and has an exit 3
catch all code. The script should behave like any other Nagios plugin.
It should run under any modern Linux distribution. It has been tested and known
to work under Debian based systems with Nagios 3.x
HISTORY
This plugin is based on check_temp which I wrote earlier this year. The code is
almost identical to it. Many thanks to Chad Columbus who sent me
bugfixes and corrections for check_temp. Without check_temp their would never
have been check_gputemp.
This plugin was submitted to Nagios Exchange in January 2012.
Version 1.3
Thanks to Ryan Loudfoot who added performance data to check_gputemp.

9
THANKS Normal file
View File

@ -0,0 +1,9 @@
check_temp THANKS file
check_gputemp was originally written by Jack-Benny Persson.
Some kind people have been contributing by reporting problems, suggesting
improvements or submitting code.
Here is a list of these kind people.
Chad Columbus ccolumbu@hotmail.com
Ryan Loudfoot elyrith@gmail.com

View File

@ -25,10 +25,12 @@
# Nagios plugin to monitor GPU temperature with aticonfig. #
# This only works on ATI cards with the proprietary driver (fglrx). #
# Written in Bash (and uses sed & awk). #
# Latest version of check_gputemp can be found at the below URL: #
# https://github.com/jackbenny/check_gputemp #
# #
###############################################################################
VERSION="Version 1.1"
VERSION="Version 1.3"
AUTHOR="(c) 2011 Jack-Benny Persson (jack-benny@cyberinfo.se)"
# Sensor program
@ -150,7 +152,7 @@ while [[ -n "$1" ]]; do
shift 2
;;
-?)
-\?)
print_help
exit $STATE_OK
;;
@ -216,21 +218,23 @@ ${SENSORPROG} --adapter=${adapter} --od-gettemperature | grep "Temperature"
printf "\n\n"
fi
# Get performance data for Nagios "Performance Data" field
PERFDATA=`${SENSORPROG} --adapter=${adapter} --od-gettemperature | grep "Temperature"`
# And finally check the temperature against our thresholds
if [[ "$TEMP" -gt "$thresh_crit" ]]; then
# Temperature is above critical threshold
echo "GPU $adapter CRITICAL - Temperature is $TEMP"
echo "GPU $adapter CRITICAL - Temperature is $TEMP | $PERFDATA"
exit $STATE_CRITICAL
elif [[ "$TEMP" -gt "$thresh_warn" ]]; then
# Temperature is above warning threshold
echo "GPU $adapter WARNING - Temperature is $TEMP"
echo "GPU $adapter WARNING - Temperature is $TEMP | $PERFDATA"
exit $STATE_WARNING
else
# Temperature is ok
echo "GPU $adapter OK - Temperature is $TEMP"
echo "GPU $adapter OK - Temperature is $TEMP | $PERFDATA"
exit $STATE_OK
fi
exit 3