Project Temperature

From Frederick Chapleau Wiki

Jump to: navigation, search

Contents

The first way to do it

That the simpliest one, when your motherboard is supported and the ACPI engine is configured correctly you just have to dump the file

/proc/acpi/thermal_zone/THRM/temperature

The second way

A nice way to do it, is to use lm_sensors. To configure it you just have to download it, install it, configure it, and use it.

download it

wget http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-3.0.2.tar.bz

install it

tar -xvf lm_sensors-3.0.2.tar.bz2
cd lm_sensors-3.0.2
make
make install

configure it

sensors-detect

use it

sensors

use it... via a PHP page

<?php
 
$return = exec("sensors",$output);
preg_match('/temp1:\s*\+([^.]*)/',implode(",",$output),$matches);
echo $matches[1]
 
 
?>
Personal tools