Archive for 26 abril 2009

h1

Como medir temperatura de la placa base, CPU, etc

26/04/2009

En GNU/Linux existe el comando “sensors” para mostrar en consola la información de los sensores de la placa base. Previamente estos deben haber sido activados en la BIOS. Para ver la temperatura se pueden seguir los siguientes pasos:

[root@server4 /]# sensors
Can't access procfs/sysfs file
Unable to find i2c bus information;
For 2.6 kernels, make sure you have mounted sysfs and done
'modprobe i2c_sensor'!
For older kernels, make sure you have done 'modprobe i2c-proc'!

[root@server4 /]# modprobe i2c_sensor
[root@server4 /]# sensors
No sensors found!
[root@server4 /]# sensors-detect (responder Intro a todo lo que pregunte)

This program will help you determine which I2C/SMBus modules you need to
load to use lm_sensors most effectively. You need to have i2c and
lm_sensors installed before running this program.
Also, you need to be `root', or at least have access to the /dev/i2c-*
files, for most things.
If you have patched your kernel and have some drivers built in, you can
safely answer NO if asked to load some modules. In this case, things may
seem a bit confusing, but they will still work.

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.
You do not need any special privileges for this.
Do you want to probe now? (YES/no):
Probing for PCI bus adapters...
Sorry, no PCI bus adapters found.

We will now try to load each adapter module in turn.
If you have undetectable or unsupported 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.
If it is built-in into your kernel, you can safely skip this.
i2c-dev is not loaded. Do you want to load it now? (YES/no):
Module loaded succesfully.

We are now going to do the adapter probings. Some adapters may hang halfway
through; we can't really help that. Also, some chips will 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. That often
includes address 0x69 (clock chip).

Some chips are also accessible through the ISA bus. ISA probes are
typically a bit more dangerous, as we have to write to I/O ports to do
this. This is usually safe though.

Do you want to scan the ISA bus? (YES/no):
Probing for `National Semiconductor LM78'
Trying address 0x0290... Failed!
Probing for `National Semiconductor LM78-J'
Trying address 0x0290... Failed!
Probing for `National Semiconductor LM79'
Trying address 0x0290... Failed!
Probing for `Winbond W83781D'
Trying address 0x0290... Failed!
Probing for `Winbond W83782D'
Trying address 0x0290... Failed!
Probing for `Winbond W83627HF'
Trying address 0x0290... Success!
(confidence 8, driver `w83781d')
Probing for `Winbond W83697HF'
Trying address 0x0290... Failed!
Probing for `Silicon Integrated Systems SIS5595'
Trying general detect... Failed!
Probing for `VIA Technologies VT82C686 Integrated Sensors'
Trying general detect... Failed!
Probing for `VIA Technologies VT8231 Integrated Sensors'
Trying general detect... Failed!
Probing for `ITE IT8705F / IT8712F / SiS 950'
Trying address 0x0290... Failed!
Probing for `IPMI BMC KCS'
Trying address 0x0ca0... Failed!
Probing for `IPMI BMC SMIC'
Trying address 0x0ca8... Failed!

Some Super I/O chips may also contain sensors. Super I/O probes are
typically a bit more dangerous, as we have to write to I/O ports to do
this. This is usually safe though.

Do you want to scan for Super I/O sensors? (YES/no):

Probing for `ITE 8702F Super IO Sensors'
Failed! (skipping family)
Probing for `Nat. Semi. PC87351 Super IO Fan Sensors'
Failed! (skipping family)
Probing for `SMSC 47B27x Super IO Fan Sensors'
Failed! (skipping family)
Probing for `VT1211 Super IO Sensors'
Failed! (0x52)
Probing for `Winbond W83627HF Super IO Sensors'
Success... found at address 0x0295
Probing for `Winbond W83627THF Super IO Sensors'
Failed! (0x52)
Probing for `Winbond W83637HF Super IO Sensors'
Failed! (0x52)
Probing for `Winbond W83697HF Super IO Sensors'
Failed! (0x52)
Probing for `Winbond W83697SF/UF Super IO PWM'
Failed! (0x52)
Probing for `Winbond W83L517D Super IO'
Failed! (0x52)

Do you want to scan for secondary Super I/O sensors? (YES/no): Probing for `ITE 8702F Super IO Sensors'
Failed! (skipping family)
Probing for `Nat. Semi. PC87351 Super IO Fan Sensors'
Failed! (skipping family)
Probing for `SMSC 47B27x Super IO Fan Sensors'
Failed! (skipping family)
Probing for `VT1211 Super IO Sensors'
Failed! (skipping family)

Now follows a summary of the probes I have just done.
Just press ENTER to continue:
Driver `w83781d' (should be inserted):
Detects correctly:
* ISA bus address 0x0290 (Busdriver `i2c-isa')
Chip `Winbond W83627HF' (confidence: 8)

Driver `w83627hf' (should be inserted):
Detects correctly:
* ISA bus address 0x0295 (Busdriver `i2c-isa')
Chip `Winbond W83627HF Super IO Sensors' (confidence: 9)

I will now generate the commands needed to load the I2C modules.
Sometimes, a chip is available both through the ISA bus and an I2C bus.
ISA bus access is faster, but you need to load an additional driver module
for it. If you have the choice, do you want to use the ISA bus or the
I2C/SMBus (ISA/smbus)?

To make the sensors modules behave correctly, add these lines to
/etc/modules.conf:

#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----

To load everything that is needed, add this to some /etc/rc* file:

#----cut here----
# I2C adapter drivers
modprobe i2c-isa
# I2C chip drivers
modprobe w83781d
modprobe w83627hf
# sleep 2 # optional
/usr/bin/sensors -s # recommended
#----cut here----


WARNING! If you have some things built into your kernel, the list above
will contain too many modules. Skip the appropriate ones! You really should
try these commands right now to make sure everything is working properly.
Monitoring programs won't work until it's done.

Do you want to generate /etc/sysconfig/lm_sensors? (YES/no): Copy prog/init/lm_sensors.init to /etc/rc.d/init.d/lm_sensors
for initialization at boot time.
[root@server4 /]#
[root@server4 /]#
[root@server4 /]#
[root@server4 /]# /etc/init.d/lm_sensors restart
Stopping lm_sensors: [ OK ]
Starting lm_sensors: [ OK ]
[root@server4 /]#
[root@server4 /]#
[root@server4 /]# sensors
w83627hf-isa-0290
Adapter: ISA adapter
VCore 1: +0.00 V (min = +0.00 V, max = +0.00 V) ALARM
VCore 2: +0.00 V (min = +0.00 V, max = +0.00 V) ALARM
+3.3V: +0.00 V (min = +3.14 V, max = +3.46 V)
+5V: +5.03 V (min = +4.73 V, max = +5.24 V) ALARM
+12V: +0.00 V (min = +10.82 V, max = +13.19 V)
-12V: -14.91 V (min = -13.18 V, max = -10.88 V)
-5V: -7.71 V (min = -5.25 V, max = -4.75 V)
V5SB: +5.59 V (min = +4.73 V, max = +5.24 V) ALARM
VBat: +1.12 V (min = +2.40 V, max = +3.60 V)
fan1: 0 RPM (min = 3026 RPM, div = 2)
fan2: 0 RPM (min = 10074 RPM, div = 2)
fan3: 0 RPM (min = 4326 RPM, div = 2)
temp1: +127°C (high = +48°C, hyst = +115°C) sensor = thermistor
temp2: +127.0°C (high = +80°C, hyst = +75°C) sensor = thermistor ALARM
temp3: +127.0°C (high = +80°C, hyst = +75°C) sensor = thermistor ALARM
ERROR: Can't get VID data!
alarms: Chassis intrusion detection ALARM
beep_enable:
Sound alarm disabled


En Debian ó Ubuntu concretamente sería parecido a:

root@shirley:/var/cache/apt/archives# apt-get install lm-sensors
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias
Leyendo la información de estado... Hecho
Se instalarán los siguientes paquetes extras:
libsensors4
Paquetes sugeridos:
sensord read-edid i2c-tools
Se instalarán los siguientes paquetes NUEVOS:
libsensors4 lm-sensors
0 actualizados, 2 se instalarán, 0 para eliminar y 0 no actualizados.
Necesito descargar 191kB de archivos.
Se utilizarán 795kB de espacio de disco adicional después de desempaquetar.
¿Desea continuar [S/n]?
Des:1 http://archive.ubuntu.com intrepid/main libsensors4 1:3.0.2-1ubuntu2 [64,7kB]
Des:2 http://archive.ubuntu.com intrepid/main lm-sensors 1:3.0.2-1ubuntu2 [126kB]
Descargados 191kB en 0s (333kB/s)
Seleccionando el paquete libsensors4 previamente no seleccionado.
(Leyendo la base de datos ...
155498 ficheros y directorios instalados actualmente.)
Desempaquetando libsensors4 (de .../libsensors4_1%3a3.0.2-1ubuntu2_amd64.deb) ...
Seleccionando el paquete lm-sensors previamente no seleccionado.
Desempaquetando lm-sensors (de .../lm-sensors_1%3a3.0.2-1ubuntu2_amd64.deb) ...
Procesando activadores para man-db ...
Configurando libsensors4 (1:3.0.2-1ubuntu2) ...
udev active, devices will be created in /dev/.static/dev/
Creating config file /etc/sensors3.conf with new version
Configurando lm-sensors (1:3.0.2-1ubuntu2) ...

Procesando activadores para libc6 ...
ldconfig deferred processing now taking place

Detección e instalación de sensores:

carlos@WhenIGrowUp:/$ sudo sensors-detect
[sudo] password for carlos:
# sensors-detect revision 5016 (2007-11-11 22:20:16 +0100)
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.
(...)
To load everything that is needed, add this to /etc/modules:
#----cut here----
# Chip drivers
it87
k8temp
#----cut here----

Do you want to add these lines automatically? (yes/NO)yes

# modprobe it87 k8temp

y muestreo de la temperatura:

root@shirley:/var/cache/apt/archives# sensors
k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp: -49.0°C
Core1 Temp: +111.0°C <- Valor falso

it8712-isa-0290
Adapter: ISA adapter
VCore 1: +1.14 V (min = +0.00 V, max = +4.08 V)
VCore 2: +4.08 V (min = +0.00 V, max = +4.08 V) ALARM
+3.3V: +3.36 V (min = +0.00 V, max = +4.08 V)
+5V: +6.85 V (min = +0.00 V, max = +6.85 V) ALARM
+12V: +12.74 V (min = +0.00 V, max = +16.32 V)
-12V: -15.33 V (min = -27.36 V, max = +3.93 V)
-5V: +4.03 V (min = -13.64 V, max = +4.03 V) ALARM
Stdby: +6.85 V (min = +0.00 V, max = +6.85 V) ALARM
VBat: +3.20 V
fan1: 1126 RPM (min = 0 RPM)
fan2: 3169 RPM (min = 0 RPM)
M/B Temp: +100.0°C (low = -1.0°C, high = +127.0°C) sensor = thermistor
CPU Temp: +43.0°C (low = -1.0°C, high = +127.0°C) sensor = thermistor
Temp3: -128.0°C (low = -1.0°C, high = +127.0°C) sensor = disabled
cpu0_vid: +1.550 V

h1

Conexión SSH lenta o con cortes

05/04/2009

En las actuales versiones de SSH (por ejemplo OpenSSH_5.1p1 Debian-5, OpenSSL 0.9.8g 19 Oct 2007 en Debian 5.0), al conectar a un servidor ssh se pueden producir retrasos, desconexiones o imposibilidad de conectar.

El problema más común es la resolución DNS equivocada del demonio sshd sobre el cliente que se intenta conectar. Se resuelve corrigiendo los DNS del servidor, incluyendo servidores DNS más fiables, y/o añadiendo la IP del cliente en el fichero /etc/hosts, así como verificando la IP propia en dicho fichero .