How to enable automatic email alarm when the disk is full in windows

Source: Internet
Author: User

In windows, how to enable automatic email alarm when the disk is full is divided into two steps: one is how to monitor the disk capacity; the other is how to enable automatic email alarm. There are two solutions to the first problem: one is to use the wmic command in the command line to write a bat script, and the other is to use the performance monitoring provided by windows. The first method is troublesome. The second method is used here. In this way, the detailed steps are as follows: Step 1 enable the "performance" function on the server, click "Start> Run", and enter "perfmon." in the "run" dialog box. run the msc command and press enter to bring up the performance management main window. Next, expand the "Performance Logs and alarms> alarms" option in sequence. Next, you can use "new alarm settings" to monitor the remaining server space. When the remaining server space is less than a certain value, the system sends an alarm to the Administrator, prompting the administrator of insufficient space. Step 2: Create a new warning setting. Next, create an alarm setting to monitor the remaining disk space. In the "performance" management main window, right-click the "alarm" option and select the "new alarm settings" option in the pop-up menu. The "new alarm settings" dialog box is displayed, in the "name" column, enter a name for the alarm, such as "Diskfree". Click "OK" to go to the alarm parameter Settings dialog box. Step 3: set alarm parameters 1. in the alarm parameter Settings dialog box, click "add" to bring up the "add counter" dialog box. Then, select "LogicalDisk" in the "performance object" drop-down list box. Select the "select counter from List" option, then select "% Free Space" in the list box, and then select the drive letter to be monitored, such as "C :", click "add. (Note: you must add alarms to monitor multiple disks, and select "_ Total" to monitor the entire disk capacity.) 2. the warning parameter and sampling interval are then returned to the alarm Parameter Setting Dialog Box. Next, you need to set the trigger warning parameter and data sampling interval parameter. If the remaining disk space is set to less than 15%, an alert is sent to the Administrator. In the "will trigger alert, if the value is" drop-down box, select the "lower" option and enter "15" in the "Limit" column ". Set the data sampling interval value. Do not set the interval too short. For example, set it to "5 minutes" and enter "5" in the "interval" column ", select "Minute" in the "unit" column ". 3. finally, switch to the "Action" tab, select the "execute this program" option in the "when an alarm is triggered" box, click "Browse", and select "mail warning. bat attaches an email warning. bat "Example: [html] @ echo off echo the disk is full. Please clean it up in time !!! The server Address is:> c: \ mail_body.txt ipconfig | find "IP Address"> c: \ mail_body.txt ::::::::::::::::: parameter settings ::: set from = test@qq.com set user = test set pass = 11111 set to = alarm@qq.com set subj = "Disk Full Alarm! "Set mail = c: \ mail_body.txt set server = smtp.qq.com set debug =-debug-log c: \ blat. log-timestamp :::::::::::::::::: run blat ::::::::::::::::: blat % mail %-to %-base64-charset Gb2312-subject % subj %-server %-f % from %-u % user %-pw % pass % debug % email alert:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.