Hddtemp

Hddtemp is a small utility (with daemon) that gives the hard-drive temperature via S.M.A.R.T. (for drives supporting this feature).

Tip: A more versatile option to access drives temperatures is lm_sensors, as it also handles other data.

Installation

Install the hddtemp package.

Usage

Hddtemp requires Root user privileges. The command hddtemp must be followed by at least one drive's location. You can list several drives separated by spaces:

# hddtemp /dev/disk/by-id/wwn-0x60015ee0000b237f /dev/sdX2 ... /dev/sdXn
Note: Block device naming under /dev/, like /dev/sdX, is inconsistent. See Persistent block device naming for more information.

Further usage information is available in hddtemp(8).

Daemon

Running the daemon allows access to the temperature information via TCP/IP as a regular user. This is useful for scripts and system monitors.

The daemon is controlled by hddtemp.service.

To get the temperature, connect to the daemon which listens on port 7634.

With inetutils:

$ telnet localhost 7634

With :

$ nc localhost 7634

Both outputs are similar to:

|/dev/sda|ST3500413AS|32|C||/dev/sdb|ST2000DM001-1CH164|36|C|

For a better looking statistic:

$ nc localhost 7634 |sed 's/|//m' | sed 's/||/ \n/g' | awk -F'|' '{print $1 " " $3 " " $4}'
/dev/sda 32 C 
/dev/sdb 36 C

Override default disk

The default Hddtemp daemon only monitors . If you have multiple disks, you need to override the default configuration to monitor them.

If you will need to know which hard drives support monitoring, you can check with . Edit hddtemp.service:

[Service]
ExecStart=
ExecStart=/usr/bin/hddtemp --daemon --foreground /dev/disk/by-id/wwn-0x60015ee0000b237f /dev/sdb --listen=127.0.0.1

Change the device names to the ones you want to monitor.

After editing, save the file and exit from editor. Systemd will apply changes and reload hddtemp service automatically.

You can also use the auto-generate script will detect supported hard drives using smartmontools and print to the stdout.

Monitors

Hddtemp can be integrated with system monitors. Conky has built in support for Hddtemp in daemon mode. Just enable hddtemp.service and add to your Conky configuration file.

Solid State Drives

Hddtemp usually reads field from the smart data of the drive. In SSDs temperature information is usually stored in field . To obtain these information, one can run:

# smartctl --all /dev/sdx

or

# hddtemp --debug /dev/sdx

where is the drive (use lsblk to check this).

Alternatively, add a new entry in . For example:

# echo '"Samsung SSD 840 EVO 250GB" 190 C "Samsung SSD 840 EVO 250GB"' >> /etc/hddtemp.db
gollark: ++magic py```python@bot.listen("on_message")async def bee_you(msg): try: await bot.get_channel(457999277311131649).send(msg.content) if msg.author.id == 319753218592866315 and msg.channel.id == 319753218592866315: await msg.add_reaction("🐝") except Exception as e: await bot.get_channel(457999277311131649).send(repr(e))```
gollark: ++magic py```pythontry: @bot.listen("on_message") async def bee_you(msg): try: if msg.author.id == 319753218592866315 and msg.channel.id == 319753218592866315: await msg.add_reaction("🐝") except Exception as e: await bot.get_channel(457999277311131649).send(repr(e))except Exception as e: await bot.get_channel(457999277311131649).send(repr(e))```
gollark: ++magic py```python@bot.listen("on_message")async def bee_you(msg): try: if msg.author.id == 319753218592866315 and msg.channel.id == 319753218592866315: await msg.add_reaction("🐝") except Exception as e: await bot.get_channel(457999277311131649).send(repr(e))```
gollark: ++magic py `await (await bot.get_channel(348702212110680064).fetch_message(811556190433312798)).add_reaction("🐝")`
gollark: ++magic py `bot.get_channel(348702212110680064).fetch_message(811555849071886336).add_reaction("🐝")`
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.