DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 9th January 2009
giga giga is offline
Port Guard
 
Join Date: May 2008
Posts: 11
Thanked 0 Times in 0 Posts
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
  #2   (View Single Post)  
Old 9th January 2009
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

Quote:
67,0
Use locale that does not use ',' instead of '.' as a float number separator, to get output as 67.0, for example like that:

# LC_ALL=C LANG=C sysctl hw.acpi.thermal.tz0.temperature
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:20 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick