2014年6月30日 星期一

Windows WMI的架構簡介

Windows Management Instrumentation (WMI)management data和操作Windows-based (OS)operating systemsinfrastructure 可以寫WMI scriptsapplications來自動化管理remote computers,但是WMI也支援operating system的其他部分和其他產品,如System Center Operations Manager、早期的Microsoft Operations Manager (MOM)Windows Remote Management (WinRM)

下圖顯示WMI infrastructure WMI providers and managed objects的關係,並且顯示WMI infrastructureWMI consumers之間的關係。
 WMI infrastructureWMI service (Winmgmtoperating system component)作為 management applicationsWMI data providersmediator he WMI repository 是一個WMI-related static data storage area
management application script 呼叫連接到一個WMI namespaceWMI service 開始執行。 WMI service經由COM interface management applications互動。


Note
WMI service 被實現為shared service host process (SVCHOST)內的 service process


WMI Components

The following list describes the key WMI components:
  • Managed objects and WMI providers
WMI provider
一個COM object ,用來monitor WMI managed objects包含DLL檔和 Managed Object Format (MOF)
如同driver,一個provider支援WMImanaged object 來讀data,和經由WMI handles messages managed object
如同WMI C++ applications,使用WMICOM API
Managed object
一個logicalphysical enterprise component,如hard disk drivenetwork adapterdatabase systemoperating systemprocessservice
一個hardware softwaresystem component ,被表示為WMI classinstance.

WMI infrastructure
一個Microsoft Windows operating system component
有兩個componentsWMI service (winmgmt,包含WMI Core)WMI repository
WMI repository
WMI namespaces所組成。
只儲存objectsstatic data,如classes defined by providers
一個被CIM Object Manager管理的central storage area
WMI service
system startup建立許多的namespace,如root\defaultroot\cimv2root\subscription,並且preinstalls一組預設的class definitions,如 Win32 ClassesWMI System Classes
作為providersmanagement applicationsWMI repository間的intermediary
  • WMI consumers
WMI consumer:一個managementapplicationscript,和WMI infrastructure作互動。能夠經由呼叫COM API for WMI Scripting API for WMIquery,enumerate data和執行provider methods

其他名詞解釋:

n   Win32 schema
包含classes and instances的定義, 代表存在typical Windows environment managed objects 

n   namespace
classesinstances的分類,比較像logical databases,而不是physical locations,包含具體的classes instancesNamespaces 經由 __Namespace system class  猶他嚴聲而來的class來表示。

n   WMI Class
一種 managed objecttemplate 定義management basic units

n   WMI method
經由WMI COM API or the Scripting API來執行, Two examples are the COM method IWbemServices::ExecMethod and the similar scripting API method SWbemServices.ExecMethod.

n   Managed Object Format (MOF)
Interface Definition Language (IDL)基礎的語言,描述management information
一個Managed Object Format (MOF) 定義provider 傳回資料和執行操作的classes

n   WMI Class Provider
為一個COM server,支援class definitionsClass providers implement methods in the IWbemServices interface to support data retrieval, modification, deletion, enumeration, and query processing.

沒有留言:

張貼留言