{{Note|1=Arguments to {{ic|hddtemp}} are directly given in {{ic|/usr/lib/systemd/system/hddtemp.service}}. This is especially important if you have multiple disks, because in the default configuration only {{ic|/dev/sda}} is monitored. Here is how to add other drives:

+

* Change the {{ic|ExecStart}} line in {{ic|/usr/lib/systemd/system/hddtemp.service}} adding the drives you want to monitor, e.g.:

+

ExecStart=/usr/bin/hddtemp -dF /dev/sda /dev/sdb

+

* Reload systemd's unit files:

+

# systemctl --system daemon-reload

+

* Restart hddtemp service:

+

{{bc|# systemctl restart hddtemp}}

+

}}

===Setup with legacy initscripts===

===Setup with legacy initscripts===

Revision as of 11:54, 29 August 2013

hddtemp is a small utility (daemonizable) that gives you the temperature of your hard drive by reading S.M.A.R.T. information (for drives that support this feature).

Installation

Usage

Daemon

Running the daemon gives you the possibility to access the temperature via an TCP/IP request, so you could use this in order to check the temperature from outside, or within some scripts.

Setup with systemd

Once hddtemp has been installed, standard systemctl procedures work to start the daemon:

# systemctl start hddtemp

To start it on boot, enable it:

# systemctl enable hddtemp

Note: Arguments to hddtemp are directly given in /usr/lib/systemd/system/hddtemp.service. This is especially important if you have multiple disks, because in the default configuration only /dev/sda is monitored. Here is how to add other drives:

Change the ExecStart line in /usr/lib/systemd/system/hddtemp.service adding the drives you want to monitor, e.g.:

ExecStart=/usr/bin/hddtemp -dF /dev/sda /dev/sdb

Reload systemd's unit files:

# systemctl --system daemon-reload

Restart hddtemp service:

# systemctl restart hddtemp

Setup with legacy initscripts

Start the daemon:

# rc.d start hddtemp

Add the daemon to the DAEMONS array in /etc/rc.conf to facilitate auto-start on boot:

# DAEMONS=(... hddtemp ...)

Usage

Another way to get the temperature is by connecting to the daemon which is listening on port 7634.

$ telnet localhost 7634

Or with netcat:

$ nc localhost 7634

Refer to the manpage for information like supported drives, logging, etc.