bff557c94b98574253cb3be44e1be18149839d90
HotDisk
A lightweight Linux tool that monitors SATA HDD temperatures, sends Discord notifications, and safely shuts down the system if disks overheat.
Note
HotDisk focuses on SATA disks (NVMe ignored). The repo contains installer scripts, systemd integration, and log rotation setup. Github repo is a mirror of https://git.djeex.fr/Djeex/hotdisk. You'll find full package, history and release note there.
📌 Table of Contents
- ✨ Features
- 📜 Script Installation (Debian/Ubuntu)
- ⚙️ Configuration Variables
- 🐞 Common issues
- ❓ How it works
- 🧑💻 Contributors
✨ Features
- Monitors SATA disk temperatures using SMART (
smartctl
). - Configurable maximum temperature threshold.
- Counts consecutive minutes above or below threshold before notifications or shutdown.
- Sends Discord notifications when disks exceed or drop below the threshold.
- Sends pre-shutdown warning before executing system shutdown.
- Configurable logging with automatic log rotation.
- Runs as a systemd service + timer for continuous monitoring.
📜 Script Installation (Debian/Ubuntu)
Requirements
bash
,smartmontools
,curl
,lsblk
(Debian/Ubuntu default)systemd
&sudo
Quick Install with Curl
curl -fsSL https://git.djeex.fr/Djeex/hotdisk/raw/branch/main/sh/hotdisk_curl_install.sh | bash && sudo /usr/local/bin/install_hotdisk.sh
This single command will:
- Download all scripts to
/usr/local/bin/
- Run interactive installation with full customization prompts
Alternative Installation Options:
- Download only:
curl -fsSL https://git.djeex.fr/Djeex/hotdisk/raw/branch/main/sh/hotdisk_curl_install.sh | bash
- Install after download:
sudo /usr/local/bin/install_hotdisk.sh
The installer will:
- Download and install all scripts to
/usr/local/bin/
- Check dependencies (smartmontools, curl, systemd)
- Create configuration with defaults or prompt for custom values
- Generate logrotate configuration for automatic log management
- Install and enable systemd service + timer for continuous monitoring
- Run HotDisk immediately for testing
Post-Installation (Non-Interactive Mode):
sudo nano /etc/hdd_temp_monitor.conf # Set your Discord webhook URL
sudo systemctl restart hotdisk.timer # Restart service with new config
Check Logs
tail -f /var/log/hdd_temp_monitor.log
⚙️ Configuration Variables
Variable | Description | Default Value |
---|---|---|
MAX_TEMP |
Maximum allowed temperature (°C) before starting shutdown count | 60 |
HOT_DURATION |
Consecutive minutes above MAX_TEMP before shutdown |
5 |
COOL_RESET_DURATION |
Consecutive minutes below MAX_TEMP to reset all counters |
5 |
LOG_FILE |
Path to the main log file | /var/log/hdd_temp_monitor.log |
LOG_ROTATE_COUNT |
Number of log files to keep | 7 |
LOG_ROTATE_PERIOD |
Rotation period for logs (daily or weekly ) |
daily |
DISCORD_WEBHOOK |
Discord webhook URL for notifications | Required |
Configuration is stored in /etc/hdd_temp_monitor.conf
and is created by the installer.
🐞 Common issues
smartctl
may fail if SATA disks do not support SMART.- Incorrect Discord webhook URL: double-check for typos.
- Installer requires
sudo
privileges for shutdown, log creation, and systemd services.
❓ How it works
Installation Process:
- Downloads scripts to
/usr/local/bin/
(hotdisk.sh, hotdisk_logger.sh, install_hotdisk.sh) - Detects if running interactively and prompts for configuration or uses defaults
- Creates
/etc/hdd_temp_monitor.conf
with monitoring settings - Sets up systemd service (
hotdisk.service
) and timer (hotdisk.timer
) - Configures automatic log rotation via logrotate
- Enables and starts the monitoring service
Monitoring Process:
- Runs every minute via systemd timer
- Discovers all SATA disks (excludes NVMe) using
lsblk
andsmartctl
- Reads temperature for each disk via SMART attributes
- Tracks consecutive minutes above/below threshold in persistent state file
- Sends Discord notifications for temperature warnings and cool-downs
- Initiates safe system shutdown if critical temperature duration exceeded
- Logs all temperature readings with timestamps for analysis
Languages
Shell
100%