You can configure a Windows Scheduled Task to trigger an email to you when the low disk space threshold is reached on your VPS or Dedicated server. You will need to download a program called sendEmail.exe to ensure reliable delivery.
- Download sendEmail (TLS Supported version) from http://caspian.dotconf.net/menu/Software/SendEmail/
- Unzip the file you downloaded and copy sendEmail.exe to your server and place it in this folder path: C:\SendEmail\sendEmail.exe
- Open the Windows Task Scheduler (Click Start > Administrative Tools > Task Scheduler).
- Click Create a Basic Task.
- Enter a name and optionally a description and click Next. For example:
Name: Low Disk Space Alert
Description: This sends an email when disk space is low.
- Select the Trigger (that is, when you want the task to start) as When a specific event is logged. Click Next.
- Select System from the Log dropdown. Select Srv from the Source dropdown. Type 2013 in the Event ID field. Click Next.
- Select Start a program for the Action. Click Next.
- In the Program/script field, enter the path to sendEmail.exe: C:\SendEmail\sendEmail.exe
- In the Add arguments (optional) field, enter this text to actually send the email, changing the values where necessary:
-f email@example.com -t to@example -u "Low Disk Space Alert for 18.104.22.168" -m "There is low disk space on the server at 22.214.171.124" -s smtp.example.com -xu firstname.lastname@example.org -xp PaSsW0rD -o tls=yes
The arguments are as follows:
-f : the From email address (should match the SMTP username below)
-t : the To email address (your email)
-u : the Email Subject
-m : the Email Body/Message
-s : your SMTP (sending) server address
-xu : your SMTP username
-xp : your SMTP password
-o tls=yes : ensures TLS is enabled if available
- Click Finish to add the task. Now whenever a low disk space event occurs, an email will be sent to you.
By default, the low disk space threshold is 10%. If you want to change this value, you'll have to edit the Windows registry as follows:
- Click Start > Run > Type regedit and press Enter.
- Navigate to the following path:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ LanmanServer \ Parameters
- From the Edit menu, choose Add Value.
- Enter DiskSpaceThreshold in the Value Name field.
- Change the Data Type to REG_DWORD.
- Enter the desired percentage value in the Data field.
- Restart your VPS to apply the new threshold.
If you have any further questions that were not answered in this article, please contact us.