A lightweight, cross-platform disk space monitoring tool that sends email alerts when disk space falls below a configurable threshold and includes optional disk health monitoring. Perfect for system administrators who need automated disk space monitoring and health status across Windows, Linux, and ARM-based systems.
Download the appropriate binary for your system from the GitHub releases page.
Available platforms:
- Windows: diskmon-mail-windows-x86_64.zip
- Linux x86_64: diskmon-mail-linux-x86_64.zip
- Linux ARM64: diskmon-mail-linux-aarch64.zip
- Linux ARM32: diskmon-mail-linux-armv7.zip
- Linux ARM: diskmon-mail-linux-arm.zip
config.example.yaml
to the same directory as the executableconfig.yaml
# Test SMTP settings (sends email regardless of disk space)
./diskmon-mail --force-mail
# Normal run (only sends alerts if disk space is low)
./diskmon-mail
# Display SMART status for all disks
./diskmon-mail --smart
Note on SMART Status: The ability to read SMART status is not guaranteed and depends on the disk, controller, and operating system. On Linux, the tool first tries to use
smartctl
(smartmontools) if available, then falls back to built-in kernel interfaces. On Windows, it uses PowerShell and WMI. The tool does not require external dependencies but will use them if available for better accuracy. On RAID arrays, SMART status may not be accurate. The tool may take a few seconds to gather SMART information, especially on Windows systems. See the Enhanced Disk Health Monitoring (Optional) section for more details.
The config.yaml
file contains all your settings:
mail_enabled: true
smtp_server: smtp.gmail.com
smtp_port: 587
smtp_user: your-email@gmail.com
smtp_pass: your-app-password
email_from: your-email@gmail.com
email_to: admin@yourcompany.com
smtp_security: starttls # options: none, starttls, ssl
# Disk Monitoring Configuration
threshold_percent: 10.0 # Alert when disk space drops below 10%
send_mail_on_unknown_status: false # Send email if SMART status is unknown
# Health Check Configuration
health_check_enabled: true # Enable/disable disk health checks (default: true)
false
for test mode (no emails sent)C:\path\to\diskmon-mail.exe
C:\path\to\
(directory containing config.yaml)Command Line:
schtasks /create /tn "DiskMon-Mail" /tr "C:\path\to\diskmon-mail.exe" /sc daily /st 00:00 /f
For desktop users who don't leave their computer running overnight, running DiskMon-Mail on system boot is more effective than scheduled tasks.
DiskMon-Mail Boot Check
Check disk space on system startup
C:\path\to\diskmon-mail.exe
C:\path\to\
(directory containing config.yaml)Command Line (Run as Administrator):
schtasks /create /tn "DiskMon-Mail Boot Check" /tr "C:\path\to\diskmon-mail.exe" /sc onstart /ru "SYSTEM" /f
Win + R
, type shell:startup
, and press Enterdiskmon-mail.exe
in the startup folderconfig.yaml
Note: This method runs when the user logs in, not when the system boots.
Win + R
, type regedit
, and press EnterHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
DiskMon-Mail
"C:\path\to\diskmon-mail.exe"
Command Line (Run as Administrator):
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "DiskMon-Mail" /t REG_SZ /d "C:\path\to\diskmon-mail.exe" /f
Add to crontab (crontab -e
):
# Run daily at midnight
0 0 * * * /path/to/diskmon-mail
# Run every hour
0 * * * * /path/to/diskmon-mail
# Run every 30 minutes
*/30 * * * * /path/to/diskmon-mail
Create /etc/systemd/system/diskmon-mail.service
:
[Unit]
Description=DiskMon-Mail Service
After=network.target
[Service]
Type=oneshot
ExecStart=/path/to/diskmon-mail
User=root
WorkingDirectory=/path/to/
[Install]
WantedBy=multi-user.target
Create /etc/systemd/system/diskmon-mail.timer
:
[Unit]
Description=Run DiskMon-Mail daily
Requires=diskmon-mail.service
[Timer]
OnCalendar=*-*-* 00:00:00
Persistent=true
[Install]
WantedBy=timers.target
Enable and start:
sudo systemctl enable diskmon-mail.timer
sudo systemctl start diskmon-mail.timer
DiskMon-Mail automatically detects and monitors:
- Windows: All local drives (C:, D:, etc.) excluding network drives
- Linux: All mounted filesystems excluding removable media (/media/, /mnt/, etc.)
- File Systems: NTFS, ext4, ext3, xfs, and others
- Threshold: Configurable percentage (default: 10% free space)
The tool skips:
- USB drives and removable media
- Network drives and mounted shares
- CD/DVD drives
- Temporary filesystems
If emails aren't being sent, test your SMTP configuration:
./diskmon-mail --force-mail
This will send test emails for all disks regardless of available space.
config.yaml
exists in the same directory as the executableFor detailed output, check the console output for:
- System information
- Disk detection results
- SMTP connection status
- Email sending confirmation
For more accurate disk health monitoring, you can install smartmontools:
Debian/Ubuntu:
sudo apt-get update
sudo apt-get install smartmontools
CentOS/RHEL/Rocky/AlmaLinux:
sudo yum install smartmontools
# or for newer versions:
sudo dnf install smartmontools
Fedora:
sudo dnf install smartmontools
Arch Linux:
sudo pacman -S smartmontools
openSUSE:
sudo zypper install smartmontools
setup.exe
installerC:\Program Files\smartmontools
For Raspberry Pi systems with SD cards, smartmontools provides limited support, but the tool includes specialized MMC/SD card health detection that:
- Checks system logs (dmesg) for I/O errors
- Reads manufacturer information from the kernel
- Detects CRC errors and timeouts
- Provides SD card-specific health status
config.yaml
securely - it contains email credentialsFor issues, feature requests, or contributions:
- Review the example configuration file
- Test SMTP settings with the --force-mail
parameter
- Test disk health info with the --smart
parameter
DiskMon-Mail - Simple, reliable disk space monitoring and health status for system administrators.