LinuxCommandLibrary

hddtemp

Report hard drive temperatures

TLDR

Display temperature of a specific drive

$ hddtemp [type]:[/dev/sdX]
copy

Display temperature of a SATA drive assigned to sda
$ hddtemp SATA:/dev/sda
copy

Log temperatures to syslog every n seconds
$ hddtemp [[-S|--syslog]] [nseconds] [type]:[/dev/sdX]
copy

Print only numeric value of temperature without unit
$ hddtemp [[-n|--numeric]] [type]:[/dev/sdX]
copy

Define the unit used to denote temperature
$ hddtemp [[-u|--unit]] [C|F] [type]:[/dev/sdX]
copy

Wake ATA drive before attempting to read temperature
$ hddtemp [[-w|--wake-up]] [type]:[/dev/sdX]
copy

Enter debug mode to show S.M.A.R.T. fields and their values
$ hddtemp [[-D|--debug]] [type]:[/dev/sdX]
copy

Suppress compatibility check for drive types
$ hddtemp [[-q|--quiet]] [type]:[/dev/sdX]
copy

SYNOPSIS

hddtemp [options] device

PARAMETERS

-d, --daemon
    Run as TCP daemon (default port 7634).

-p PORT, --port=PORT
    Daemon port (default: 7634).

-l HOST, --listen=HOST
    Daemon listen address (default: all interfaces).

-n, --no-drive-temp
    Omit drive temperature from output.

-u UNIT, --unit=UNIT
    Output unit: C (Celsius, default), F (Fahrenheit), K (Kelvin).

-q, --quiet
    Suppress non-error output.

-s, --stdout
    Write to stdout (daemon mode).

-t, --thermal
    Show thermal sensor if available.

-D, --debug
    Enable debug output.

--help
    Show help.

--version
    Show version.

-d N, --drive=N
    Select drive number in SCSI enclosures.

DESCRIPTION

hddtemp is a lightweight Linux command-line tool designed to retrieve the internal temperature of hard disk drives (HDDs) and solid-state drives (SSDs) that support S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology). It queries ATA, SCSI, and SAS drives from manufacturers like Seagate, Western Digital, Samsung, Hitachi, Fujitsu, and IBM, using a database of known drive signatures to parse responses accurately.

The tool outputs the temperature in Celsius by default, along with the drive model and serial number. It can operate standalone for one-off checks or as a daemon providing TCP access for monitoring tools like Nagios, Munin, or MRTG. This makes it ideal for system administration, server monitoring, and preventive maintenance to avoid overheating issues.

hddtemp relies on direct disk access, so it typically requires root privileges unless run with user namespaces or udev rules. It supports drive selection by number in multi-drive setups and customizable units (Celsius, Fahrenheit, Kelvin). The daemon mode listens on a configurable port (default 7634), allowing remote queries in formats like Nagios plugins.

Limitations include dependency on drive firmware support for temperature reporting; not all SSDs expose reliable temps. It's actively maintained with an updated drive database.

CAVEATS

Requires root or smartmontools privileges; not all drives/SSDs report temperature; daemon exposes network service—use firewall.

DRIVE DATABASE

Uses /usr/share/hddtemp/hddtemp.db for vendor/model recognition; update via package manager.

NAGIOS USAGE

Daemon mode supports plugins: echo '/dev/sda' | nc host 7634 returns parsable output.

HISTORY

Originally developed by Elie De Brauwer in 2002; maintained by Arnaud Ebalard and contributors. Drive database updated regularly for new models; packaged in major distros since early 2000s.

SEE ALSO

smartctl(8), smartd(8), hdparm(8)

Copied to clipboard