6 Commits
v0.7 ... v0.8

4 changed files with 24 additions and 12 deletions

19
HISTORY Normal file
View File

@@ -0,0 +1,19 @@
Version 0.2:
Line 103, fixed the missing "-n" option (Thanks to Chad who pointed this out
this out for me). Also added a "shopt -s extglob". (Thx to Chad)
Version 0.5:
Line 168, fixed a typo (EXIT_UNKNOWN to STATE_UNKNOWN)
Version 0.7:
Line 193, modified sensor parsing to cut after the first '+' since all
positive temperatures are preceded by a '+'
Line 211, reduced "verbosity" needed to see verbose info (was 2: -v -v)
Line 229-232, now checks to see if no sensor data was found and
exits with STATE_UNKNOWN
Version 0.8:
Line 196 and 230, added 'head -n1' to only fetch the first result from
sensors output. On some machine you get two Core0 and two Core1 temps.
Moved version history to it's own file, HISTORY

0
README Normal file → Executable file
View File

0
THANKS Normal file → Executable file
View File

View File

@@ -27,18 +27,9 @@
# Latest version of check_temp can be found at the below URL: # # Latest version of check_temp can be found at the below URL: #
# https://bitbucket.org/jackbenny/check_temp # # https://bitbucket.org/jackbenny/check_temp #
# # # #
# Version 0.2: Line 103, fixed the missing "-n" option (Thanks to Chad who #
# pointed this out for me). Also added a "shopt -s extglob". (Thx to Chad) #
# Version 0.5: Line 168, fixed a typo (EXIT_UNKNOWN to STATE_UNKNOWN) #
# Version 0.7: #
# Line 193, modified sensor parsing to cut after the first '+' since all #
# positive temperatures are preceded by a '+' #
# Line 211, reduced "verbosity" needed to see verbose info (was 2: -v -v) #
# Line 229-232, now checks to see if no sensor data was found and #
# exits with STATE_UNKNOWN #
############################################################################### ###############################################################################
VERSION="Version 0.7" VERSION="Version 0.8"
AUTHOR="(c) 2011 Jack-Benny Persson (jack-benny@cyberinfo.se)" AUTHOR="(c) 2011 Jack-Benny Persson (jack-benny@cyberinfo.se)"
# Sensor program # Sensor program
@@ -193,7 +184,9 @@ fi
#Get the temperature #Get the temperature
TEMP=`${SENSORPROG} | grep "$sensor" | cut -d+ -f2 | cut -c1-2 ` TEMP=`${SENSORPROG} | grep "$sensor" | cut -d+ -f2 | cut -c1-2 | head -n1`
#Old way - Get the temperature
#TEMP=`${SENSORPROG} | grep "$sensor" | awk '{print $3}' | cut -c2-3 | head -n1`
# Check if the thresholds have been set correctly # Check if the thresholds have been set correctly
@@ -225,7 +218,7 @@ printf "\n\n"
fi fi
# Get performance data for Nagios "Performance Data" field # Get performance data for Nagios "Performance Data" field
PERFDATA=`${SENSORPROG} | grep "$sensor"` PERFDATA=`${SENSORPROG} | grep "$sensor" | head -n1`
# And finally check the temperature against our thresholds # And finally check the temperature against our thresholds