个人工具

“UbuntuHelp:SensorInstallHowto”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的4个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/SensorInstallHowto}}
 
{{From|https://help.ubuntu.com/community/SensorInstallHowto}}
 
{{Languages|UbuntuHelp:SensorInstallHowto}}
 
{{Languages|UbuntuHelp:SensorInstallHowto}}
Ubuntu can monitor CPU and other system temperatures, fan speeds, and other system data, using an application called lm-sensors and another application to display lm-sensors's data on your desktop.
+
Ubuntu can monitor CPU and other system temperatures, fan speeds, and other system data using an application called lm-sensors. It can also show this information on your desktop or GNOME panel using one of several other applications. lm-sensor's homepage is http://secure.netroedge.com/~lm78/download.html
Warning: IBM Thinkpad users should not install LM Sensors. Full story is available here.
+
This Howto was adapted from [http://www.ubuntuforums.org/showthread.php?t=2780 this Ubuntu Forums thread]. That thread was written for Ubuntu 4.10; lm-sensors installation is significantly easier in all supported versions of Ubuntu.
sensor homepage
+
Make sure to read the Comments below for later versions of Ubuntu.
http://secure.netroedge.com/~lm78/download.html
+
This Howto is from [http://www.ubuntuforums.org/showthread.php?t=2780 this Ubuntu Forums thread].
+
 
=== Install and Configure lm-sensors ===
 
=== Install and Configure lm-sensors ===
Install the following packages <code><nowiki>lm-sensors</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]).
+
<ol><li>Install the <code><nowiki>lm-sensors</nowiki></code> package (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]).
Run the mkdev.sh script in the lm-sensors source. It is extracted below:
+
</li><li>Run sudo sensors-detect and answer YES to all YES/no questions. I generally use the ISA bus rather than the SMBus bus, your choice to this question!.
Copy the script file below to a text editor and save it to a file named mkdev.sh.
+
</li><li>At the end of sensors-detect, a list of modules that needs to be loaded will displayed. Type "yes" to have sensors-detect insert those modules into /etc/modules, or edit /etc/modules yourself.
<pre><nowiki>
+
</li><li>Next, run "sudo /etc/init.d/module-init-tools restart". This will read the changes you made to /etc/modules in step 3, and insert the new modules into the kernel.</li></ol>
#!/bin/bash
+
# Here you can set several defaults.
+
# The number of devices to create (max: 256)
+
NUMBER=32
+
# The owner and group of the devices
+
OUSER=root
+
OGROUP=root
+
# The mode of the devices
+
MODE=600
+
  
# This script doesn't need to be run if devfs is used
+
=== Test lm-sensors ===
if [ -r /proc/mounts ] ; then
+
Next, you should test that lm-sensors works correctly. Run the "sensors" command and check the output. Example output is below:
if grep -q "/dev devfs" /proc/mounts ; then
+
echo "You do not need to run this script as your system uses devfs."
+
exit;
+
fi
+
fi
+
 
+
i=0;
+
 
+
while [ $i -lt $NUMBER ] ; do
+
echo /dev/i2c-$i
+
mknod -m $MODE /dev/i2c-$i c 89 $i || exit
+
chown "$OUSER:$OGROUP" /dev/i2c-$i || exit
+
i=$[$i + 1]
+
done
+
#end of file
+
</nowiki></pre>
+
Make the file executable:
+
 
<pre><nowiki>
 
<pre><nowiki>
chmod 755 mkdev.sh
+
w83627dhg-isa-0290
</nowiki></pre>
+
Adapter: ISA adapter
Run mkdev.sh from the current directory
+
VCore:      +1.13 V  (min =  +0.00 V, max =  +1.74 V) 
<pre><nowiki>
+
in1:        +11.30 V  (min =  +0.90 V, max =  +0.05 V)  ALARM
sudo ./mkdev.sh
+
AVCC:        +3.28 V  (min =  +2.11 V, max =  +2.40 V)  ALARM
</nowiki></pre>
+
3VCC:        +3.28 V  (min =  +2.05 V, max =  +0.37 V)  ALARM
3. Now run sensors-detect and answer YES to all YES/no questions. I generally use the ISA bus rather than the SMBus bus, your choice to this question!. At the end of the detection phase, a list of modules that needs to be loaded will displayed. You will need to write these down or print the list for the next steps.
+
in4:        +1.41 V  (min =  +0.00 V, max =  +1.57 V) 
 +
in5:        +1.65 V  (min =  +0.02 V, max =  +0.14 V)  ALARM
 +
in6:        +4.45 V  (min =  +3.28 V, max =  +1.64 V)  ALARM
 +
VSB:        +3.28 V  (min =  +0.14 V, max =  +3.07 V)  ALARM
 +
VBAT:        +3.22 V  (min =  +2.06 V, max =  +1.02 V)  ALARM
 +
Case Fan:      0 RPM  (min = 2636 RPM, div = 128)  ALARM
 +
CPU Fan:    1117 RPM  (min = 1591 RPM, div = 8)  ALARM
 +
Aux Fan:      0 RPM  (min = 1171 RPM, div = 128)  ALARM
 +
fan5:          0 RPM  (min =  659 RPM, div = 128)  ALARM
 +
Sys Temp:    +31.0°C  (high = +18.0°C, hyst = +96.0°C)  sensor = thermistor
 +
CPU Temp:    +33.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = diode
 +
AUX Temp:  +124.5°C  (high = +80.0°C, hyst = +75.0°C)  ALARM  sensor = thermistor
 +
cpu0_vid:  +1.163 V
  
<pre><nowiki>
+
coretemp-isa-0000
sudo sensors-detect
+
Adapter: ISA adapter
</nowiki></pre>
+
Core 0:     +43.0°C  (high = +82.0°C, crit = +100.0°C) 
Below is an example of results from sensors-detect:
+
<pre><nowiki>
+
#************************************************* *****************************
+
To make the sensors modules behave correctly, add these lines to
+
/etc/modules:
+
  
#----cut here----
+
coretemp-isa-0001
# I2C adapter drivers
+
Adapter: ISA adapter
i2c-viapro
+
Core 1:     +43.0°C  (high = +82.0°C, crit = +100.0°C) 
i2c-isa
+
# I2C chip drivers
+
eeprom
+
it87
+
#----cut here----
+
</nowiki></pre>
+
Then, run /etc/init.d/module-init-tools
+
To make the sensors modules behave correctly, add these lines to
+
/etc/modprobe.d/local and run update-modules ([[* *]]):
+
<pre><nowiki>
+
#----cut here----
+
# I2C module options
+
alias char-major-89 i2c-dev
+
#----cut here----
+
#**********************************
+
</nowiki></pre>
+
In this example, we add the modules in reverse order (order is critical!) in "/etc/modules".
+
<pre><nowiki>
+
#***************************************************************
+
# /etc/modules: kernel modules to load at boot time.
+
#
+
# This file should contain the names of kernel modules that are
+
# to be loaded at boot time, one per line. Comments begin with
+
# a "#", and everything on the line after them are ignored.
+
  
psmouse
+
coretemp-isa-0002
mousedev
+
Adapter: ISA adapter
ide-cd
+
Core 2:      +40.0°C  (high = +82.0°C, crit = +100.0°C) 
ide-disk
+
ide-generic
+
lp
+
  
#For lm-sensors, i2c modules
+
coretemp-isa-0003
it87
+
i2c-viapro
+
i2c-isa
+
 
+
#end of file!
+
#*****************************************
+
</nowiki></pre>
+
[[Anchor(*)]] * I found that there was no "/etc/modprobe.d/local" and that "alias char-major-89 i2c-dev" was already listed in "/etc/modprobe.d/aliases". So, nothing to do here.
+
Now load the modules manually using modprobe and update the dependencies.
+
<pre><nowiki>
+
sudo modprobe i2c-sensor
+
sudo modprobe i2c-viapro
+
sudo modprobe i2c-isa
+
sudo modprobe it87
+
 
+
sudo depmod -a <may not be needed!>
+
sudo update-modules <may not be needed!>
+
</nowiki></pre>
+
Now test the sensor output using the lm-sensors utility "sensors".
+
<pre><nowiki>
+
sensors
+
 
+
************************************************** *****************
+
it87-isa-0290
+
 
Adapter: ISA adapter
 
Adapter: ISA adapter
VCore 1: +1.57 V (min = +1.42 V, max = +1.57 V) ALARM
+
Core 3:     +43.0°C  (high = +82.0°C, crit = +100.0°C)   
VCore 2: +2.66 V (min = +2.40 V, max = +2.61 V) ALARM
+
+3.3V: +6.59 V (min = +3.14 V, max = +3.46 V) ALARM
+
+5V: +5.11 V (min = +4.76 V, max = +5.24 V)
+
+12V: +11.78 V (min = +11.39 V, max = +12.61 V)
+
-12V: -19.14 V (min = -12.63 V, max = -11.41 V) ALARM
+
-5V: +0.77 V (min = -5.26 V, max = -4.77 V) ALARM
+
Stdby: +5.00 V (min = +4.76 V, max = +5.24 V)
+
VBat: +3.12 V
+
fan1: 3668 RPM (min = 0 RPM, div =
+
fan2: 0 RPM (min = 664 RPM, div = ALARM
+
fan3: 0 RPM (min = 2657 RPM, div = 2) ALARM
+
M/B Temp: +39°C (low = +15°C, high = +40°C) sensor = thermistor
+
CPU Temp: +36°C (low = +15°C, high = +45°C) sensor = thermistor
+
Temp3: +96°C (low = +15°C, high = +45°C) sensor = diode
+
************************************************** ********************
+
 
</nowiki></pre>
 
</nowiki></pre>
Reboot Ubuntu and the sensors should now be detected during the boot process properly!
+
This sensors output shows four devices: w83627dhg-isa-0290 (motherboard sensors) and coretemp-isa-0000 through 0004 (Intel Core sensors). The motherboard sensor device has information on the voltages received from the power supply unit by the motherboard (in1-6), the fan speeds (entries with RPM), and various internal temperatures. As you can see, some sensors are obviously incorrect (e.g. AUX Temp and Case/Aux Fan); this tends to be the case with at least some of the sensors on most motherboards.
 
The sensor output may be tweaked by editing the "/etc/sensors.conf" file. It is possible to correct inaccurate scaling too. For details check '''"man sensors.conf"'''.
 
The sensor output may be tweaked by editing the "/etc/sensors.conf" file. It is possible to correct inaccurate scaling too. For details check '''"man sensors.conf"'''.
 
=== Get Sensor Information Displayed on your Desktop ===
 
=== Get Sensor Information Displayed on your Desktop ===
Search Synaptic for either "sensors" to bring up a list of sensor-related applications, including '''xsensors''' and '''ksensors'''.  
+
Search Synaptic for either "sensors" to bring up a list of sensor-related applications, including '''xsensors''', '''ksensors''', and '''sensors-applet'''.  
 +
==== ksensors ====
 
Ksensors seems to work better for many people, and be easier to configure. Install the <code><nowiki>ksensors</nowiki></code> package (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). Start it from terminal with '''ksensors''', and you should be able to choose which temperature, fan RPM, or other displays you want.
 
Ksensors seems to work better for many people, and be easier to configure. Install the <code><nowiki>ksensors</nowiki></code> package (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). Start it from terminal with '''ksensors''', and you should be able to choose which temperature, fan RPM, or other displays you want.
 
https://help.ubuntu.com/community/SensorInstallHowto?action=AttachFile&do=get&target=ksensors.png
 
https://help.ubuntu.com/community/SensorInstallHowto?action=AttachFile&do=get&target=ksensors.png
 
To get Ksensors to start when your computer starts, go '''System menu --> Preferences --> Sessions''', and in the last tab, '''Startup Programs''', add ksensors. (or whichever sensors display program you choose to use).
 
To get Ksensors to start when your computer starts, go '''System menu --> Preferences --> Sessions''', and in the last tab, '''Startup Programs''', add ksensors. (or whichever sensors display program you choose to use).
For a GNOME alternative, you can apt-get or Synaptic search/install of "sensors-applet", a GNOME panel applet that displays temperatures and fan speeds from lm-sensors. After installation, you right click on any panel that you want to have it displayed on, and click "add to panel". Under the category of "system and hardware" there should be a icon with the text "hardware system monitor". Click on this icon, and drag it to the panel where you want the information displayed. At first it will just display a bunch of text, but you can change it to a icon view and which temperatures/fan speeds get displayed by right clicking on the applet -> preferences.
+
==== sensors-applet ====
 +
For a GNOME alternative, you can apt-get or Synaptic search/install of "sensors-applet", a GNOME panel applet that displays temperatures and fan speeds from lm-sensors.
 +
During installation, you'll be presented with the option to start the hddtemp daemon at startup. Choose "no" here if there was a sensor detected previously that reports your hard drive temperature, otherwise choose "yes".
 +
After installation, you can right click on any panel that you want to have sensor information displayed on, and click "Add to Panel...". In the "Add to Panel" window, there should be a icon with the text "Hardware Sensors Monitor". Click on this entry, then click "Add". You can change the applet's settings by right-clicking on the applet and choosing "Preferences".
 
https://help.ubuntu.com/community/SensorInstallHowto?action=AttachFile&do=get&target=sensors-applet.png
 
https://help.ubuntu.com/community/SensorInstallHowto?action=AttachFile&do=get&target=sensors-applet.png
sensors-applet also supports "hddtemp", so if you want it to also display your hard drive temperatures, you can apt-get or synaptic search/install for "hddtemp" and then restart the applet by removing it from the panel, and then it should be in the list of available sensors to show on the panel.
 
 
=== Comments ===
 
=== Comments ===
 
In Gutsy the process to configure lm-sensors is much simpler. I installed lm-sensors and sensors-applet, ran sudo sensors-detect (and said yes to everything). It asks if I want it to automatically add the modules to /etc/modules, I said yes. Then restart to get the modules (one could do some modprobing, but just restarting is easier) . Then I added the sensor applet to my panel. -- SamTygier
 
In Gutsy the process to configure lm-sensors is much simpler. I installed lm-sensors and sensors-applet, ran sudo sensors-detect (and said yes to everything). It asks if I want it to automatically add the modules to /etc/modules, I said yes. Then restart to get the modules (one could do some modprobing, but just restarting is easier) . Then I added the sensor applet to my panel. -- SamTygier
 +
The original thread was written with Warty 4.10 in mind. The simple process seems to apply for Dapper, Gutsy, Hardy, and Intrepid, so I've removed the over-complicated cruft that used to be here -- Robert Wall
 +
==== Jaunty, Karmic and Lucid ====
 +
In Jaunty, Karmic, and Lucid, the procedure in Sam Tygier's comment works fine. Just open a Terminal (Applications -> Terminal) and type:
 +
<pre><nowiki>
 +
sudo apt-get install lm-sensors sensors-applet
 +
</nowiki></pre>
 +
Next, run sensors-detect. I answered "no" to the question about automatically checking the hard disks on the pop-up screen because I wasn't sure (as the instructions for sensors-detect state), and "yes" to all the sensor probes that follow.
 +
<pre><nowiki>
 +
sudo sensors-detect
 +
</nowiki></pre>
 +
Finally, restart to load all the sensors. Once back at the desktop, right-click on the top panel and choose "Add to Panel." Select "Hardware Sensors Monitor" and click the "Add" button, then "Close." Right-click on all the sensors that appear and choose "Preferences." Click the "Sensors" tab. There you can select/de-select all the relevant sensors and adjust their low and high values as well as set alarms if desired.
 
----
 
----
[[category:CategoryDocumentation]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月20日 (四) 00:09的最新版本


Ubuntu can monitor CPU and other system temperatures, fan speeds, and other system data using an application called lm-sensors. It can also show this information on your desktop or GNOME panel using one of several other applications. lm-sensor's homepage is http://secure.netroedge.com/~lm78/download.html This Howto was adapted from this Ubuntu Forums thread. That thread was written for Ubuntu 4.10; lm-sensors installation is significantly easier in all supported versions of Ubuntu. Make sure to read the Comments below for later versions of Ubuntu.

Install and Configure lm-sensors

  1. Install the lm-sensors package (see InstallingSoftware).
  2. Run sudo sensors-detect and answer YES to all YES/no questions. I generally use the ISA bus rather than the SMBus bus, your choice to this question!.
  3. At the end of sensors-detect, a list of modules that needs to be loaded will displayed. Type "yes" to have sensors-detect insert those modules into /etc/modules, or edit /etc/modules yourself.
  4. Next, run "sudo /etc/init.d/module-init-tools restart". This will read the changes you made to /etc/modules in step 3, and insert the new modules into the kernel.

Test lm-sensors

Next, you should test that lm-sensors works correctly. Run the "sensors" command and check the output. Example output is below:

w83627dhg-isa-0290
Adapter: ISA adapter
VCore:       +1.13 V  (min =  +0.00 V, max =  +1.74 V)   
in1:        +11.30 V  (min =  +0.90 V, max =  +0.05 V)   ALARM
AVCC:        +3.28 V  (min =  +2.11 V, max =  +2.40 V)   ALARM
3VCC:        +3.28 V  (min =  +2.05 V, max =  +0.37 V)   ALARM
in4:         +1.41 V  (min =  +0.00 V, max =  +1.57 V)   
in5:         +1.65 V  (min =  +0.02 V, max =  +0.14 V)   ALARM
in6:         +4.45 V  (min =  +3.28 V, max =  +1.64 V)   ALARM
VSB:         +3.28 V  (min =  +0.14 V, max =  +3.07 V)   ALARM
VBAT:        +3.22 V  (min =  +2.06 V, max =  +1.02 V)   ALARM
Case Fan:      0 RPM  (min = 2636 RPM, div = 128)  ALARM
CPU Fan:    1117 RPM  (min = 1591 RPM, div = 8)  ALARM
Aux Fan:       0 RPM  (min = 1171 RPM, div = 128)  ALARM
fan5:          0 RPM  (min =  659 RPM, div = 128)  ALARM
Sys Temp:    +31.0°C  (high = +18.0°C, hyst = +96.0°C)  sensor = thermistor
CPU Temp:    +33.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = diode
AUX Temp:   +124.5°C  (high = +80.0°C, hyst = +75.0°C)  ALARM  sensor = thermistor
cpu0_vid:   +1.163 V

coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +43.0°C  (high = +82.0°C, crit = +100.0°C)  

coretemp-isa-0001
Adapter: ISA adapter
Core 1:      +43.0°C  (high = +82.0°C, crit = +100.0°C)  

coretemp-isa-0002
Adapter: ISA adapter
Core 2:      +40.0°C  (high = +82.0°C, crit = +100.0°C)  

coretemp-isa-0003
Adapter: ISA adapter
Core 3:      +43.0°C  (high = +82.0°C, crit = +100.0°C)  

This sensors output shows four devices: w83627dhg-isa-0290 (motherboard sensors) and coretemp-isa-0000 through 0004 (Intel Core sensors). The motherboard sensor device has information on the voltages received from the power supply unit by the motherboard (in1-6), the fan speeds (entries with RPM), and various internal temperatures. As you can see, some sensors are obviously incorrect (e.g. AUX Temp and Case/Aux Fan); this tends to be the case with at least some of the sensors on most motherboards. The sensor output may be tweaked by editing the "/etc/sensors.conf" file. It is possible to correct inaccurate scaling too. For details check "man sensors.conf".

Get Sensor Information Displayed on your Desktop

Search Synaptic for either "sensors" to bring up a list of sensor-related applications, including xsensors, ksensors, and sensors-applet.

ksensors

Ksensors seems to work better for many people, and be easier to configure. Install the ksensors package (see InstallingSoftware). Start it from terminal with ksensors, and you should be able to choose which temperature, fan RPM, or other displays you want. SensorInstallHowto?action=AttachFile&do=get&target=ksensors.png To get Ksensors to start when your computer starts, go System menu --> Preferences --> Sessions, and in the last tab, Startup Programs, add ksensors. (or whichever sensors display program you choose to use).

sensors-applet

For a GNOME alternative, you can apt-get or Synaptic search/install of "sensors-applet", a GNOME panel applet that displays temperatures and fan speeds from lm-sensors. During installation, you'll be presented with the option to start the hddtemp daemon at startup. Choose "no" here if there was a sensor detected previously that reports your hard drive temperature, otherwise choose "yes". After installation, you can right click on any panel that you want to have sensor information displayed on, and click "Add to Panel...". In the "Add to Panel" window, there should be a icon with the text "Hardware Sensors Monitor". Click on this entry, then click "Add". You can change the applet's settings by right-clicking on the applet and choosing "Preferences". SensorInstallHowto?action=AttachFile&do=get&target=sensors-applet.png

Comments

In Gutsy the process to configure lm-sensors is much simpler. I installed lm-sensors and sensors-applet, ran sudo sensors-detect (and said yes to everything). It asks if I want it to automatically add the modules to /etc/modules, I said yes. Then restart to get the modules (one could do some modprobing, but just restarting is easier) . Then I added the sensor applet to my panel. -- SamTygier The original thread was written with Warty 4.10 in mind. The simple process seems to apply for Dapper, Gutsy, Hardy, and Intrepid, so I've removed the over-complicated cruft that used to be here -- Robert Wall

Jaunty, Karmic and Lucid

In Jaunty, Karmic, and Lucid, the procedure in Sam Tygier's comment works fine. Just open a Terminal (Applications -> Terminal) and type:

sudo apt-get install lm-sensors sensors-applet

Next, run sensors-detect. I answered "no" to the question about automatically checking the hard disks on the pop-up screen because I wasn't sure (as the instructions for sensors-detect state), and "yes" to all the sensor probes that follow.

sudo sensors-detect

Finally, restart to load all the sensors. Once back at the desktop, right-click on the top panel and choose "Add to Panel." Select "Hardware Sensors Monitor" and click the "Add" button, then "Close." Right-click on all the sensors that appear and choose "Preferences." Click the "Sensors" tab. There you can select/de-select all the relevant sensors and adjust their low and high values as well as set alarms if desired.