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 →
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
atelier:chantier:hddtemp-dev-disk-by-id-conky [23/04/2020 10:29] Debian Alain créée |
atelier:chantier:hddtemp-dev-disk-by-id-conky [25/04/2020 13:25] DarKou [Introduction] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== hddtemp /dev/disk/by-id/ conky ====== | ====== hddtemp /dev/disk/by-id/ conky ====== | ||
- | * Objet : faire fonctionne hddtemp dans conky avec une identification par id | + | * Objet : faire fonctionner hddtemp dans conky avec une identification par id |
* Niveau requis : débutant avisé | * Niveau requis : débutant avisé | ||
* Commentaires : //hddtemp utilise l'identification par sdX , souvent elle est aléatoire . | * Commentaires : //hddtemp utilise l'identification par sdX , souvent elle est aléatoire . | ||
Ligne 16: | Ligne 16: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | hddtem utilise par défaut le nommage par /dev/sdX , | + | 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 | + | 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 : | + | En préambule, il faut installer comme suit hddtemp : |
<code root>apt install hddtemp </code> | <code root>apt install hddtemp </code> | ||
+ | |||
+ | 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) : | ||
<code root>dpkg-reconfigure hddtemp</code> | <code root>dpkg-reconfigure hddtemp</code> | ||
Ligne 36: | Ligne 38: | ||
{{https://debian-facile.org/images/file-R8648856b9dd7415a67a6e8021eb6089a.png}} | {{https://debian-facile.org/images/file-R8648856b9dd7415a67a6e8021eb6089a.png}} | ||
- | ensuite , configurer le fichier /etc/default/hddtemp comme suit : | + | Ensuite, configurer le fichier /etc/default/hddtemp comme suit : |
+ | se baser sur la recherche des id : | ||
+ | chez moi : | ||
+ | <code user>ls -lh /dev/disk/by-id/</code> | ||
+ | <code>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 | ||
+ | ... / ... | ||
+ | </code> | ||
+ | |||
+ | <code root>nano -w /etc/default/hddtemp</code> | ||
+ | |||
+ | <code> #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="" | ||
+ | </code> | ||
+ | |||
+ | |||
+ | ===== Test ===== | ||
+ | |||
+ | la commande : | ||
+ | |||
+ | <code root>hddtemp /dev/disk/by-id/wwn-0x500a0751e134d584</code> | ||
+ | donne chez moi : | ||
+ | <code>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</code> | ||
+ | |||
+ | de même, dans conky : | ||
+ | <code user>${alignc} disque ssd : ${hddtemp /dev/disk/by-id/wwn-0x500a0751e134d584}°C</code> | ||
+ | |||
+ | donne : | ||
+ | |||
+ | {{https://debian-facile.org/images/file-R6c8adfb35f6817f5a13827ff6885abff.png}} | ||
- | ===== Installation ===== | ||
===== Utilisation ===== | ===== Utilisation ===== | ||
+ | |||
+ | <code>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"</code> | ||
+ | |||
+ | 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. | ||