Etusivu

Liisa

Autot
Juhlat
Kotiteatteri
Kuvaaminen
Sukeltaminen
Matkailu
Musiikki
Ohjelmat
Roolipelit
Ruuanvalmistus
Tietokoneet
Arkistot
Sekalainen
Sivuhakemisto

This shellscript prints the date, load average as well as the motherboard and CPU temperature (in microcelsius) in a single row once every minute. In order to work, you need to have a functioning sensors setup.
#!/bin/bash

# Edit these according to your local settings
moboTempSensor="/sys/devices/platform/i2c-9191/9191-0290/temp1_input"
cpuTempSensor="/sys/devices/platform/i2c-9191/9191-0290/temp3_input"
interval=60

while [ /bin/true ]
do
  dat=`date '+%Y.%m.%d-%H:%M:%S' | tr -d '\n'`
  load=`cut -f 1 -d ' ' /proc/loadavg`
  mobo=`cat ${moboTempSensor}`
  cpu=`cat  ${cpuTempSensor}`
  echo "${dat} ${load} ${cpu} ${mobo}"
  sleep ${interval}
done

Then run it for example like this:

/loadtemp.sh | tee -a /tmp/loadtemp.log
And when you have collected enough data, you can visualize it by running the following commands in gnuplot:
set autoscale
set xtic auto
set ytic auto
set y2tic auto
set ylabel "Temperature (C)"
set y2label "Load"
set yrange [20:60]
set y2range [0:3]
set timefmt "%Y.%m.%d-%H:%M:%S"
set xdata time
set xrange ["2006.11.13-00:00:00":"2006.11.21-00:00:00"]
set format x "%Y.%m.%d"
set terminal png medium notransparent picsize 1280 960
set output "/tmp/loadtemp.png"
plot "/tmp/loadtemp.log" using 1:2 title 'load' axes x1y2  with lines, \
     "/tmp/loadtemp.log" using 1:($3/1000) title 'CPU' with lines, \
     "/tmp/loadtemp.log" using 1:($4/1000) title 'Motherboard'  with lines
And you have a nice 1280x960 png in /tmp/ which shows the temperature changes like this one. You need to adjust the yrange, y2range as well as xrange according to your dataset.

Copyright (c) Paul-Erik Törrönen unless explicitly mentioned otherwise

Masseter koirakoulu

Vempain Publishing System