Thread: CPU temp
View Single Post
  #1   (View Single Post)  
Old 9th January 2009
giga giga is offline
Port Guard
 
Join Date: May 2008
Posts: 11
Default CPU temp

I am trying to get this CPU temp script to work:

http://wiki.bsdforen.de/howto/systemueberwachung

But when I run this script, I get an error:

ERROR: temperature.rrd: conversion of '67,0' to float not complete: tail ',0'

How can I fix it?

Code:
#!/bin/sh

cpu_temp="hw.acpi.thermal.tz0.temperature"
disk="/dev/ad0"

smartctl="/usr/local/sbin/smartctl"
smartarg="-A"
option="194"  # smart option for temp
cmd="/sbin/sysctl"
rrdtool="/usr/local/bin/rrdtool"
rrdfile="temperature.rrd"

h=`$smartctl $smartarg $disk | grep $option | awk '{print $10}'`
t=`$cmd $cpu_temp | awk '{print $2}' | sed -e s/C//`

# RRD Datenbank aktualisieren
$rrdtool update $rrdfile N:$t:$h
Reply With Quote