LINUX

Come installare i sensori lm su Linux

lm-sensors linux

lm-sensors fornisce un driver di monitoraggio dello stato dell’hardware per Linux. Viene utilizzato dagli amministratori di sistema per verificare lo stato di salute del proprio hardware. Viene anche utilizzato per monitorare l’infrastruttura hardware nei server ed è molto utile nelle applicazioni critiche. Ma impostarlo per l’uso è relativamente facile. Di seguito viene mostrato come installare lo strumento lm sensor sulla tua distribuzione Ubuntu/Debian e Fedora Linux.

1) Installazione

Su distribuzioni Ubuntu e Debian

# apt install lm-sensors

Su distribuzioni Linux Fedora 26 e RPM

# dnf install lm_sensors

Una volta completata l’installazione, eseguire i seguenti comandi per verificare le specifiche hardware correnti.

# sudo sensors-detect

Ti farà alcune domande. Rispondi Sì per tutti.

```
[root@localhost bin]# sensors-detect
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# System: ASUSTeK COMPUTER INC. X540LA [1.0] (laptop)
# Kernel: 4.11.11-300.fc26.x86_64 x86_64
# Processor: Intel(R) Core(TM) i3-5020U CPU @ 2.20GHz (6/61/4)

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.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): yes
Silicon Integrated Systems SIS5595... No
VIA VT82C686 Integrated Sensors... No
VIA VT8231 Integrated Sensors... No
AMD K8 thermal sensors... No
AMD Family 10h thermal sensors... No
AMD Family 11h thermal sensors... No
AMD Family 12h and 14h thermal sensors... No
AMD Family 15h thermal sensors... No
AMD Family 16h thermal sensors... No
AMD Family 15h power sensors... No
AMD Family 16h power sensors... No
Intel digital thermal sensor... Success!
 (driver `coretemp')
Intel AMB FB-DIMM thermal sensor... No
Intel 5500/5520/X58 thermal sensor... No
VIA C7 thermal sensor... No
VIA Nano thermal sensor... No

Some Super I/O chips contain embedded 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): yes
/dev/port: Operation not permitted

Some hardware monitoring chips are 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): yes
/dev/port: Operation not permitted

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): yes
Found unknown SMBus adapter 8086:9ca2 at 0000:00:1f.3.
Sorry, no supported PCI bus adapters found.
Module i2c-dev loaded successfully.

Next adapter: i915 gmbus vga (i2c-0)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: i915 gmbus dpc (i2c-1)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: i915 gmbus dpb (i2c-2)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: i915 gmbus dpd (i2c-3)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: DPDDC-A (i2c-4)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: DPDDC-B (i2c-5)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: SMBus I801 adapter at 4040 (i2c-6)
Do you want to scan it? (YES/no/selectively): yes
Client found at address 0x52
Probing for `Analog Devices ADM1033'... No
Probing for `Analog Devices ADM1034'... No
Probing for `SPD EEPROM'... Yes
 (confidence 8, not a hardware monitoring chip)

Next adapter: Synopsys DesignWare I2C adapter (i2c-7)
Do you want to scan it? (YES/no/selectively): yes
Adapter doesn't support all probing functions.
Some addresses won't be probed.

Next adapter: Synopsys DesignWare I2C adapter (i2c-8)
Do you want to scan it? (YES/no/selectively): yes
Adapter doesn't support all probing functions.
Some addresses won't be probed.

Now follows a summary of the probes I have just done.
Just press ENTER to continue:

Driver `coretemp':
 * Chip `Intel digital thermal sensor' (confidence: 9)

Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no): yes
Unloading i2c-dev... OK

[root@localhost bin]#

```

Test dei sensori lm

Infine, per ottenere il tipo di temperatura della CPU sensors nel tuo terminale Questo lo verifica lm-sensors lo strumento funziona correttamente. Inoltre, per controllare la temperatura della CPU, la velocità della ventola e altri dati, esegui il seguente comando:

[root@localhost bin]# sensors
asus-isa-0000
Adapter: ISA adapter
cpu_fan: 2100 RPM
temp1: +49.0°C

acpitz-virtual-0
Adapter: Virtual device
temp1: +49.0°C (crit = +108.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +50.0°C (high = +105.0°C, crit = +105.0°C)
Core 0: +49.0°C (high = +105.0°C, crit = +105.0°C)
Core 1: +50.0°C (high = +105.0°C, crit = +105.0°C)

pch_wildcat_point-virtual-0
Adapter: Virtual device
temp1: +47.0°C

L’output di questo sensore mostra due dispositivi: asus-isa-0000 (sensori della scheda madre) e ccoretemp-isa-0000 (sensori Intel Core). Il dispositivo sensore della scheda madre contiene informazioni sulle tensioni ricevute dall’alimentatore dalla scheda madre (in1-6), velocità della ventola (input RPM) e varie temperature interne.

2) Installa e personalizza la GUI lm-sensor: Psensor

a) Installare il sensore

Se non vuoi usare lm-sensor con il terminale, puoi installare psensor, che è la GUI per lm-sensor.

Su sistema Debian

# apt install psensor
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following additional packages will be installed:
 libappindicator3-1 libdbusmenu-glib4 libdbusmenu-gtk3-4 libindicator3-7 libjson-c3 libxnvctrl0 psensor-common
The following NEW packages will be installed:
 libappindicator3-1 libdbusmenu-glib4 libdbusmenu-gtk3-4 libindicator3-7 libjson-c3 libxnvctrl0 psensor psensor-common

Sui sistemi Redhat, psensor non è disponibile dal repository di sistema predefinito, quindi sarà necessario compilarlo dal sorgente. Per prima cosa dovremo installare wget

# dnf install wget
Last metadata expiration check: 0:24:13 ago on Wed 23 Aug 2017 03:54:38 AM UTC.
Dependencies resolved.
======================================================================================================================================================
 Package                         Arch                              Version                                    Repository                         Size
======================================================================================================================================================
Installing:
 wget                            x86_64                            1.19.1-3.fc26                              fedora                            725 k

Ora installa i pacchetti richiesti per la compilazione

# dnf group install 'Development Tools'
Last metadata expiration check: 0:50:12 ago on Wed 23 Aug 2017 03:54:38 AM UTC.
Dependencies resolved.

Ora puoi scaricare l’ultima versione di psensor (1.2.0) mentre scrivi questo articolo dalla fonte

# wget http://wpitchoune.net/psensor/files/psensor-1.2.0.tar.gz
--2017-08-23 04:31:01-- http://wpitchoune.net/psensor/files/psensor-1.2.0.tar.gz
Resolving wpitchoune.net (wpitchoune.net)... 92.243.29.231

ora puoi decomprimerlo

# tar xvf psensor-1.2.0.tar.gz 
psensor-1.2.0/
psensor-1.2.0/test-driver
psensor-1.2.0/ar-lib

Ora possiamo compilare psensor

# cd psensor-1.2.0
# ./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
# make install
Making install in doc
make[1]: Entering directory '/root/psensor-1.2.0/doc'
make[2]: Entering directory '/root/psensor-1.2.0/doc'

b) Lanciare e personalizzare psensor

Ora che psensor è installato, puoi avviarlo tramite il menu grafico per ottenere un risultato come di seguito:

Puoi scegliere quale elemento apparirà sul grafico deselezionandolo da destra, come ho deselezionato di seguito temp1, Nucleo1e ST500LT012-1DG142

Hai la possibilità di modificare le preferenze di psensor. Puoi modificare

  • Preferenze: dove puoi cambiare la modalità di avvio dello strumento, la sua interfaccia o la presentazione grafica come di seguito psensore -> preferenze
  • Preferenze del sensore: qui puoi modificare il modo in cui lo strumento psensor funzionerà sui servizi monitorati come gli allarmi per avere notifiche o modificare i nomi dei servizi come di seguito tramite psensore -> Preferenze sensore

Quindi potresti vedere una notifica che potrebbe apparire come di seguito

Il lm-sensors è uno strumento molto utile per eseguire controlli dello stato dell’hardware. Tuttavia, a causa della scarsa interfaccia CLI, la maggior parte degli utenti preferisce le applicazioni basate su GUI. Tuttavia, lm-sensor può essere configurato per utilizzare strumenti GUI come sensors-applet, psensor che è un’app GTK che mostra i grafici della CPU, la temperatura dell’HDD, la velocità della ventola, ecc. lm-sensors può essere ulteriormente configurato per controllare le ventole del sistema utilizzando fancontrol scenario. Questo può essere fatto facilmente correndo sudo pwmconfig ordinare e seguire attentamente le istruzioni.

Related Articles

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Back to top button
Close