logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).


L'icône rouge permet de télécharger chaque page du wiki visitée au format PDF et la grise au format ODT → ODT PDF Export

Ceci est une ancienne révision du document !


Table des matières

hddtemp /dev/disk/by-id/ conky

Nota :

Contributeurs, les FIXME sont là pour vous aider, supprimez-les une fois le problème corrigé ou le champ rempli !

Introduction

hddtemp utilise par défaut le nommage par /dev/sdX.

Ce nommage étant aléatoire, il est possible de le forcer à utiliser le nommage par /dev/disks/by-id/XXXXXX.

En préambule, il faut installer comme suit hddtemp :

apt install hddtemp 

Puis le reconfigurer afin qu'il soit lancé au démarrage de notre système et qu'il soit accessible par nos programmes (ici conky) :

dpkg-reconfigure hddtemp

Nous devons ensuite configurer le fichier /etc/default/hddtemp afin de lui dire de lire aussi les disques nommés sous forme la /dev/disk/by-id/XXXXXX.

Pour obtenir la correspondance entre /dev/sdX et /dev/disk/by-id/XXXXXX nous pouvons faire un ls -l dans le dossier /dev/disk/by-id/.

Voici ce que j'obtiens :

ls -lh /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 avril 23 08:39 ata-CT500MX500SSD4_1813E134D584 -> ../../sdf
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 ata-HL-DT-ST_BD-RE_BH10LS38_K9IB9NE1359 -> ../../sr1
lrwxrwxrwx 1 root root  9 avril 23 08:39 ata-HL-DT-ST_BD-RE_BH10LS38_K9IC31M4320 -> ../../sr0
lrwxrwxrwx 1 root root  9 avril 23 08:39 ata-ST2000DL003-9VT166_6YD1QBLS -> ../../sdc
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 ata-ST2000DM001-1CH164_Z1E2XAN7 -> ../../sdb
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 ata-ST2000DM001-9YN164_Z1E0AC50 -> ../../sda
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 ata-ST4000VM000-2AF166_WDH0AFF6 -> ../../sdd
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 ata-ST4000VX007-2DT166_ZGY57FLJ -> ../../sde
... / ...
lrwxrwxrwx 1 root root 11 avril 23 08:39 md-name-Alain-PC:0 -> ../../md127
lrwxrwxrwx 1 root root 11 avril 23 08:39 md-uuid-4d4f9d9d:b7119121:c474b6d3:f56af7d6 -> ../../md127
lrwxrwxrwx 1 root root  9 avril 23 08:39 wwn-0x5000c5003fa4e30d -> ../../sda
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 wwn-0x5000c500465b459f -> ../../sdc
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 wwn-0x5000c5004fbead7a -> ../../sdb
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 wwn-0x5000c5009ca2e849 -> ../../sdd
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 wwn-0x5000c500b67c94c2 -> ../../sde
... / ...
lrwxrwxrwx 1 root root  9 avril 23 08:39 wwn-0x500a0751e134d584 -> ../../sdf
... / ...

Nous reportons ainsi la liste des devices qui nous intéresse dans le fichier de configuration d'hddtemp (ligne DISKS)

nano -w /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.
RUN_DAEMON="true"

# List of devices you want to use with hddtemp. If none specified,
# hddtemp will probe standard devices.
#DISKS="/dev/hda"
DISKS="/dev/sd[a-f] /dev/disk/by-id/wwn-0x5000c5003fa4e30d /dev/disk/by-id/wwn-0x5000c5004fbead7a /dev/disk/by-id/wwn-0x5000c500465b459f /dev/disk/by-id/wwn-0x5000c5009ca2e849 /dev/disk/by-id/wwn-0x5000c500b67c94c2 /dev/disk/by-id/wwn-0x500a0751e134d584"

# 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
RUN_SYSLOG="1"

# Other options to pass to hddtemp
OPTIONS="" 

Test

Il ne nous reste plus qu'a tester pour voir si hddtemp récupère bien les températures de nos disques.

Exemple avec le disque wwn-0x500a0751e134d584 (sdf) :

alain@Alain-PC:~$ sudo hddtemp /dev/disk/by-id/wwn-0x500a0751e134d584
[sudo] Mot de passe de alain : 
/dev/disk/by-id/wwn-0x500a0751e134d584: CT500MX500SSD4: 46°C

Nous pouvons alors reporter cette commande dans conky afin de monitorer la température de notre disque :

${alignc}      disque ssd : ${hddtemp /dev/disk/by-id/wwn-0x500a0751e134d584}°C

Utilisation

DISKS="/dev/sd[a-f] /dev/disk/by-id/wwn-0x5000c5003fa4e30d /dev/disk/by-id/wwn-0x5000c5004fbead7a /dev/disk/by-id/wwn-0x5000c500465b459f /dev/disk/by-id/wwn-0x5000c5009ca2e849 /dev/disk/by-id/wwn-0x5000c500b67c94c2 /dev/disk/by-id/wwn-0x500a0751e134d584"

Avec la modification ci-dessus du fichier /etc/default/hddtemp, vous avez accès aussi bien à la notation /dev/sdX qu'a la notation /dev/disk/by-id/XXXXX.

1)
N'hésitez pas à y faire part de vos remarques, succès, améliorations ou échecs !
atelier/chantier/hddtemp-dev-disk-by-id-conky.1587814283.txt.gz · Dernière modification: 25/04/2020 13:31 par DarKou

Pied de page des forums

Propulsé par FluxBB