This article directly refers to the blog Park software Life of the article operation, written here only to make a record.
To the company side of the first two report server received. To prevent downtime, deploy an SSIS package with disk warnings.
Step 1 establishes two variables to receive and write disk capacity
Step 2 Create WMI and SMTP connection managers
Step 3 Drag a WMI Data Reader Task and configure it
Note that almost every option has to be changed
SELECT from where DriveType=3 and DeviceID='C:'
Step 4 Drag a script Task and configure it
LongGb= 1024x768 * 1024x768 * 1024x768; //Todo:ADDyour code here dts.variables["Diskresults"]. Value= Double. Parse (dts.variables["Diskusageresults"]. Value.tostring ())/GB; Dts.taskresult=(int) scriptresults.success;
(Note, I clicked Edit script when the error, it should be installed before the new version of SSDT deleted, in the old SSDT will be a problem.) Erase the original VS-related stuff and reinstall SSDT.)
Constraint restrictions:
Finally, set up SMTP.
Problem
SQL Agent default startup account NT service\sqlserveragent cross-service access WMI prompt failed, and I tried to add this account to the management group. Then we found a local account to start the SQL Agent. Look at the data as if WMI only recognized the local account. Please explain the situation to other small partners.
Reference documents
Summary WMI-related knowledge
Http://blog.chinaunix.net/uid-7672958-id-2599044.html
Could not load file or assembly ' Microsoft.VisualStudio.Tools.Applications.Core '
http://pietervanhove.azurewebsites.net/?p=461
Wql-wmi Event Watcher Task-access Denied
https://social.technet.microsoft.com/Forums/sqlserver/en-US/fe033702-d1e9-4276-a2a4-99a7ae61c722/ Wql-wmi-event-watcher-task-access-denied?forum=sqlintegrationservices
Monitor remote server disk space and send mail alerts through SSIS