El primer paso es instalar las librerías y demonios que se encargaran de acceder a los sensores de temperatura, velocidad y voltaje de la placa, como siempre abriremos una sesión en el servidor mediante SSH y ejecutaremos el comando siguiente:
aptitude install lm-sensors sensord
Una vez instalado ya tendremos a nuestra disposición todo lo necesario, pero primero tendremos que detectar los sensores de nuestra placa, para ello utilizaremos el comando "sensors-detect" es un asistente que solo habrá que ir siguiendo paso a paso.
En todas las preguntas menos en la última debemos contestar la opción por defecto, y cuando nos pregunte "To load everything that is needed, add this to /etc/modules:" le diremos que si, para que añada las líneas necesarias con los módulos del kernel que permitirán monitorizar nuestra placa, por ejemplo:
servidor:~# sensors-detect
# sensors-detect revision 5249 (2008-05-11 22:56:25 +0200)
This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.
We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no):
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 0000:00:1f.3: Intel 82801G ICH7
We will now try to load each adapter module in turn.
Module `i2c-i801' already loaded.
If you have undetectable or unsupported I2C/SMBus adapters, you can have
them scanned by manually loading the modules before running this script.
To continue, we need module `i2c-dev' to be loaded.
Do you want to load `i2c-dev' now? (YES/no):
Module loaded successfully.
We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.
Next adapter: SMBus I801 adapter at 0500 (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x50
Probing for `Analog Devices ADM1033'... No
Probing for `Analog Devices ADM1034'... No
Probing for `SPD EEPROM'... Yes
(confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'... No
Some chips are also accessible through the ISA I/O ports. We have to
write to arbitrary I/O ports to probe them. This is usually safe though.
Yes, you do have ISA I/O ports even if you do not have any ISA slots!
Do you want to scan the ISA I/O ports? (YES/no):
Probing for `National Semiconductor LM78' at 0x290... No
Probing for `National Semiconductor LM78-J' at 0x290... No
Probing for `National Semiconductor LM79' at 0x290... No
Probing for `Winbond W83781D' at 0x290... No
Probing for `Winbond W83782D' at 0x290... No
Probing for `IPMI BMC KCS' at 0xca0... No
Probing for `IPMI BMC SMIC' at 0xca8... No
Some Super I/O chips may also contain sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'... No
Trying family `SMSC'... No
Trying family `VIA/Winbond/Fintek'... No
Trying family `ITE'... Yes
Found `ITE IT8718F Super IO Sensors' Success!
(address 0x290, driver `it87')
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'... No
Trying family `SMSC'... No
Trying family `VIA/Winbond/Fintek'... No
Trying family `ITE'... No
Some south bridges, CPUs or memory controllers may also contain
embedded sensors. Do you want to scan for them? (YES/no):
Silicon Integrated Systems SIS5595... No
VIA VT82C686 Integrated Sensors... No
VIA VT8231 Integrated Sensors... No
AMD K8 thermal sensors... No
AMD K10 thermal sensors... No
Intel Core family thermal sensor... No
Intel AMB FB-DIMM thermal sensor... No
Now follows a summary of the probes I have just done.
Just press ENTER to continue:
Driver `it87' (should be inserted):
Detects correctly:
* ISA bus, address 0x290
Chip `ITE IT8718F Super IO Sensors' (confidence: 9)
I will now generate the commands needed to load the required modules.
Just press ENTER to continue:
To load everything that is needed, add this to /etc/modules:
#----cut here----
# Chip drivers
it87
#----cut here----
Do you want to add these lines automatically? (yes/NO) yes
Tras haber añadido la lista de drivers necesarios será necesario reiniciar el equipo, para ello podemos usar uno de los comandos siguientes:
reboot
shutdown -r now
Ahora si ejecutamos el comando "sensors" podremos ver todos los que se han detectado, en este punto podemos encontrarnos con dos alternativas, que haya configuración especifica para nuestro sensor y que no, aunque lo normal será que si en caso negativo veremos lo siguiente:
servidor:~# sensors
it8718-isa-0290
Adapter: ISA adapter
in0: +1.12 V (min = +1.01 V, max = +1.20 V)
in1: +1.84 V (min = +1.60 V, max = +2.00 V)
in2: +3.28 V (min = +3.01 V, max = +3.60 V)
in3: +4.08 V (min = +0.00 V, max = +4.08 V) ALARM
in4: +2.99 V (min = +2.80 V, max = +3.30 V)
in5: +0.06 V (min = +0.00 V, max = +4.08 V)
in6: +0.03 V (min = +0.00 V, max = +4.08 V)
in7: +4.08 V (min = +0.00 V, max = +4.08 V) ALARM
in8: +3.15 V
fan1: 2257 RPM (min = 1000 RPM)
fan2: 0 RPM (min = 1000 RPM) ALARM
fan3: 0 RPM (min = 0 RPM)
temp1: -55.0°C (low = +127.0°C, high = +127.0°C) sensor = transistor
temp2: -2.0°C (low = +127.0°C, high = +127.0°C) sensor = transistor
temp3: +36.0°C (low = +127.0°C, high = +127.0°C) sensor = thermal diode
cpu0_vid: +2.050 V
Hay voltajes raros, temperaturas sin sentido, etc. eso es porque nos sobran sensores, la configuración de los diferentes chips de monitorización se hace en el fichero "/etc/sensors3.conf", al que en mi caso tuve que indicar que sensores eran validos, ajustar algunos, ponerles nombre, etc:
chip "it8718-*"
label in0 "VCore"
set in0_min 1.0
set in0_max 1.2
label in1 "VDDR"
set in1_min 1.6
set in1_max 2.0
label in2 "+3.3V"
set in2_min 3.00
set in2_max 3.60
ignore in3
label in4 "+12V"
compute in4 @*4, @/4
set in4_min 11.2
set in4_max 13.2
ignore in5
ignore in6
ignore in7
label in8 "VBat"
set in8_min 2.8
set in8_max 3.4
label temp1 "MB Temp"
compute temp1 (@+128)/3, (3*@-128)
set temp1_over 50
set temp1_low 15
label temp2 "CPU Temp"
compute temp2 (@+128)/3, (3*@-128)
set temp2_over 60
set temp2_low 15
label temp3 "SYS Temp"
ignore temp1
ignore temp2
label temp3 "CPU Temp"
set temp3_over 60
set temp3_low 10
label fan1 "CPU Fan"
#set fan1_min 1000
set fan1_div 4
#label fan2 "SYS Fan"
#set fan2_min 1000
ignore fan2
ignore fan3
Tras lo que ya tengo las lecturas correctas y los niveles de alerta necesarios:
servidor:~# sensors
it8718-isa-0290
Adapter: ISA adapter
VCore: +1.12 V (min = +1.01 V, max = +1.20 V)
VDDR: +1.84 V (min = +1.60 V, max = +2.00 V)
+3.3V: +3.28 V (min = +3.01 V, max = +3.60 V)
+12V: +11.97 V (min = +11.20 V, max = +13.18 V)
VBat: +3.15 V
CPU Fan: 2250 RPM (min = 1000 RPM)
SYS Temp: +36.0°C (low = +127.0°C, high = +127.0°C) sensor = thermal diode
cpu0_vid: +2.050 V
Ahora que ya lo tenemos bien monitorizado podemos configurar la frecuencia con la que queremos que se generen alertas y se registren las temperaturas en el log o si queremos generar una base de datos RRD con las estadísticas para dibujar gráficos, puesto que todo esto ya escapa del objetivo del tutorial simplemente indicaros que de ello se encarga el demonio "sensord" y se configura en el fichero de texto "/etc/default/sensord"