Hddtemp

Da Guide@Debianizzati.Org.
Vai alla navigazione Vai alla ricerca
Edit-clear-history.png Attenzione. Questa guida è da considerarsi abbandonata, per via del tempo trascorso dall'ultima verifica.

Potrà essere resa obsoleta, previa segnalazione sul forum, se nessuno si propone per l'adozione.


Debian-swirl.png Versioni Compatibili

Debian 6 "squeeze"
Debian 7 "wheezy"
Debian 8 "jessie"

Descrizione

Il programma hddtemp monitora e crea rapporti sulla temperatura dei seguenti hard disk PATA, SATA o SCSI con la lettura delle informazioni da Self-Monitoring Analysis and Reporting Technology (SMART) sulle unità che supportano questa caratteristica.

Installazione

# apt-get install hddtemp

Utilizzo

Per maggiori informazioni man hddtemp, hddtemp -h; un esempio di utilizzo:

# hddtemp /dev/sda 
 /dev/sda: ST380023AS: 30°C
Bulb.png Suggerimento
Per avere l'output di tutti i dischi con un solo comando:
$ hddtemp /dev/sd?
/dev/sda: ST31000528AS: 43°C
/dev/sdb: WDC WD5000AAKS-00YGA0: 46°C
/dev/sdc: WDC WD5000AAKS-00YGA0: 46°C

oppure di tutte le partizioni:

$ hddtemp /dev/sd*
/dev/sda: ST31000528AS: 43°C
/dev/sda1: ST31000528AS: 43°C
/dev/sda2: ST31000528AS: 43°C
/dev/sda3: ST31000528AS: 43°C
/dev/sda5: ST31000528AS: 43°C
/dev/sda6: ST31000528AS: 43°C
/dev/sda7: ST31000528AS: 43°C
/dev/sdb: WDC WD5000AAKS-00YGA0: 46°C
/dev/sdb1: WDC WD5000AAKS-00YGA0: 46°C
/dev/sdc: WDC WD5000AAKS-00YGA0: 46°C
/dev/sdc1: WDC WD5000AAKS-00YGA0: 46°C
/dev/sdc2: WDC WD5000AAKS-00YGA0: 46°C
/dev/sdc3: WDC WD5000AAKS-00YGA0: 46°C


Demone

hddtemp ha anche un demone con un file di configurazione in /etc/default/hddtemp :

# Defaults for hddtemp initscript (/etc/init.d/hddtemp)
# This is a POSIX shell fragment

# [automatically edited by postinst, do not change line format ]

# hddtemp network daemon switch. If set to true, hddtemp will listen
# for incoming connections.   ### cambiare da false a true ###
RUN_DAEMON="true"

# List of devices you want to use with hddtemp. If none specified,
# hddtemp will probe standard devices.   ### inserire i propri dischi ###
DISKS="/dev/sda /dev/sdb /dev/sdc "

# List of devices you want to use with hddtemp, but that would not be
# probed for a working sensor.
DISKS_NOPROBE=""

# IP address of the interface on which you want hddtemp to be bound
# on. If none specified, goes to 127.0.0.1. Use 0.0.0.0 to bind hddtemp
# on all interfaces.
INTERFACE="127.0.0.1"

# Port number on which you want hddtemp to listen on. If none specified,
# the port 7634 is used.
PORT="7634"

# Database file to use. If none specified, /etc/hddtemp.db is used.
#DATABASE="/etc/hddtemp.db"

# Separator to use between fields. The default separator is '|'.
#SEPARATOR="|"

# Logging period (in seconds) for the temperatures. If set to a value
# different than 0, hddtemp will run as a daemon periodically logging
# the temperatures through syslog    ### tempo in secondi 300=5 minuti ###
RUN_SYSLOG="300"

# Other options to pass to hddtemp
OPTIONS=""

dopo le modifiche potrebbe essere necessario riavviare il demone.

Per ottenere un output utile:

$ nc localhost 7634
|/dev/sda|ST31000528AS|43|C||/dev/sdb|WDC WD5000AAKS-00YGA0|46|C||/dev/sdc|WDC WD5000AAKS-00YGA0|46|C|

Permessi utente

Potrebbe essere necessario usare hddtemp come user, in tal caso riconfigurare con il comando:

# dpkg-reconfigure hddtemp


Hddtemp.jpeg
Hddtemp1.jpeg
Hddtemp2.jpeg

Utile nell'uso di superkaramba o conky dove molte richieste hanno i permessi dell'user e nel caso di hddtemp non rendono alcun output se mancano i permessi per eseguire il comando.

Applicazioni

È possibile usare i vari output splittandoli o tagliandoli per inserirli in altre applicazioni come superkaramba o conky.

per conky come in esempio :

 ${execi 300 nc localhost 7634}

per ottenenere:

 /dev/sda: WDC WD5000AAKS-00YGA0: 46°C 

oppure prelevando solo una parte:

 ${execi hddtemp -n /dev/sda |cut -c 34-38}

con output:

 46°C

allo stesso modo ma cambiando la sinstassi è possibile usarlo con superkaramba come in esempio :

 text x=30 y=80 sensor=program program="hddtemp /dev/sda | cut -c 24-29"




Guida scritta da: Mm-barabba 00:49, 9 apr 2011 (CEST Swirl-auth60.png Debianized 60%
Estesa da:
Mm-barabba 01:10, 4 lug 2012 (CEST)
Verificata da:
S3v (tranne che per Superkaramba/Conky)
Selky 17:28, 15 apr 2016 (CEST) (tranne che per Superkaramba/Conky)

Verificare ed estendere la guida | Cos'è una guida Debianized