On 10/18/06, Rob Munsch <rmunsch at solutionsforprogress.com> wrote:
ipmitool sensor | grep Temp | awk -F\| '{print $1,$2,$3,$4}' > $BBTMP/cputemp.$host
cpu_temp=
tail -n 4 $BBTMP/cputemp.$host |head -n 1 | awk '{print $2}' |sed 's/\..*//g'
Is there a compelling reason not to fold the above into one line:
temp=`ipmitool sensor | tail -n 4 | head -n 1 | awk '{ print $3 }'`
Ok, we have the temp in degrees as an integer.
Now to see if it's Very Bad.
if temp > 130 then
Does this bit work?? I get:
./ipmi.sh: line 22: temp: command not found
and an empty file called '130'. This works for me:
if [ $temp -gt 130 ]
then
The simplest way to graph it would be to have the message read something like:
cpu temp : $temp
then follow the instructions in the "Custom Graphs" entry from the Help dropdown. You already have the first part - collecting the data. If you use NCV, the above line would go into the RRD as cputemp, because it takes everything before the colon and strips out spaces to make the name, then takes the rest of the line as the number. That probably a gross over-simplification... :)
Ralph