bookmark bookmark

Temperaturen auslesen:

Datenbank:

  1. /usr/local/bin/rrdtool create temperature.rrd\
  2. DS:cpu_temp:GAUGE:600:0:U\
  3. DS:hdd_temp:GAUGE:600:0:U\
  4. RRA:AVERAGE:0.5:1:2016\
  5. RRA:AVERAGE:0.5:6:1824\
  6. RRA:AVERAGE:0.5:12:1656\
  7. RRA:AVERAGE:0.5:24:1176\
  8. RRA:AVERAGE:0.5:288:830\
  9. RRA:MIN:0.5:1:2016\
  10. RRA:MIN:0.5:6:1824\
  11. RRA:MIN:0.5:12:1656\
  12. RRA:MIN:0.5:24:1176\
  13. RRA:MIN:0.5:288:830\
  14. RRA:MAX:0.5:1:2016\
  15. RRA:MAX:0.5:6:1824\
  16. RRA:MAX:0.5:12:1656\
  17. RRA:MAX:0.5:24:1176\
  18. RRA:MAX:0.5:288:830

Werte:

  1. #!/bin/sh
  2. cpu_temp=”hw.acpi.thermal.tz0.temperature”
  3. disk=”/dev/ad1″
  4. smartctl=”/usr/local/sbin/smartctl”
  5. smartarg=”-A”
  6. option=”194″ # smart option for temp
  7. cmd=”/sbin/sysctl”
  8. rrdtool=”/usr/local/bin/rrdtool”
  9. rdfile=”/var/db/rrd/temperature.rrd”
  10. h=`$smartctl $smartarg $disk | grep $option | awk ‘{print $10}’`
  11. t=`$cmd $cpu_temp | awk ‘{print $2}’ | sed -e s/C//`
  12. # RRD Datenbank aktualisieren
  13. rrdtool update $rrdfile N:$t:$h