Windows Management Instrumentation (Wmi) is one of the top secrets of windows. It allows you to manage Windows platforms through a script interface. WMI data reading tasks use the WQL language (WMA special language) to access management servers or work platforms (such as viewing system logs ). Query statements can output results to variables. The WMI data reading task can complete the following tasks.
- Query possible error messages in transaction logs
- Query running applicationsProgram
- Query how many Ram instances are available during package running
- Determine how much disk space is available
You can configure the WMI data reading Task 3-22 on the editing page. It is preferred to create a WMI connection on the WMI connection management interface. If the wqlquerysourcetype attribute is set to whether to directly enter the query statement, get it from the variable or from the file, and select the query to run for the wqlquerysource attribute, it can be a variable name, a text file name, or a query statement.
Figure 3-22
The outputtype attribute is set to only output the query value or output together with the column name, And the overwritedestination attribute is set to whether the result is overwritten every time the operation is performed.
The WQL query language is very similar to the SQL query language. For example, the following query language queries the available space of disk C, and the name and other metrics. The following example queries the log information about SQL Server and SSIs.
OutputtypeSet the attribute to output only the query value or output together with the column name,OverwritedestinationSet whether to rewrite the result every time you run the attribute.
WQL Query Language and SQL The query language is very similar, for example, the following Query Language Query C Available disk space, name, and other measurements
1 SelectFreespace, DeviceID, size, systemname, descriptionFromWin32_logicaldisk
2 WhereDeviceID= 'C:'
The output result is as follows:
code highlighting produced by actipro codehighlighter (freeware)
http://www.CodeHighlighter.com/
--> 1 description, Local Fixed disk
2 DeviceID, c:
3 freespace, 32110985216
4
5 size, 60003381248
6 systemname, bknight
In the following exampleSQL ServerAndSSISSome log information
1 Select * From Win32_ntlogevent Where
2 Logfile = ' Application ' And
3 (Sourcename = ' Sqlisservice ' Or Sourcename = ' Sqlispackage ' )
4 And Timegenerated > ' 20100817 '
The output result is similar:
1 0
2 Bknight
3 12289
4 1073819649
5 3
6 System. String []
7 Application
8 3738
9 Sqlispackage
10 20050430174924.000000 - 240
11 20050430174924.000000 - 240
12 Information
13 Bknight \ Brian knight
14 0
WMI event listening tasks enable SSIS listening to WMI transaction. It works with WMI jobs in the Data graph area have similar functions, WMI tasks that can be completed by event listening tasks:
·Monitors the write of files in a folder
·Wait for the service program to start
· wait for a package or whether the memory usage of the top 10 servers reached a certain level before transferring files
· wait CPU idle
Last feature, waitingCPUWhen idle, you can use a statement similar to the following to determineCPUIs the usage less50%
1 Select * From _ Instancemodificationevent 2 Where Targetinstance Isa
2 ' Win32_processor ' And Targetinstance. loadpercentage < 50
3
Attribute editing page and WMI Data Reading tasks are very similar, 3-23 . Afterevent If the conditions are met, the task returns successfully. If the conditions are met, the request conditions are maintained. You can also use Actionattimeout And Aftertimeout Set the timeout time and response time. Timeout Attribute to set the task execution time.
Figure 3-23