2014年6月30日 星期一

Windows WMI的架構簡介

Windows Management Instrumentation (WMI)是management data和操作Windows-based (OS)operating systems的infrastructure。 可以寫WMI scripts或applications來自動化管理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 infrastructure、WMI consumers之間的關係。
在 WMI infrastructure,WMI service (Winmgmt,operating system component)作為 management applications和WMI data providers的mediator ,he WMI repository 是一個WMI-related static data 的storage area。
當management application或 script 呼叫連接到一個WMI namespace,WMI 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支援WMI從managed object 來讀data,和經由WMI 來handles messages到 managed object。
如同WMI C++ applications,使用WMI的COM API。
Managed object:
一個logical或physical enterprise component,如hard disk drive、network adapter、database system、operating system、process、service。
一個hardware或 software的system component ,被表示為WMI class的instance。.

WMI infrastructure:
一個Microsoft Windows operating system component。
有兩個components:WMI service (winmgmt,包含WMI Core)、WMI repository。
WMI repository:
由WMI namespaces所組成。
只儲存objects的static data,如classes defined by providers。
一個被CIM Object Manager管理的central storage area。
WMI service:
在system startup建立許多的namespaces ,如root\default、root\cimv2、root\subscription,並且preinstalls一組預設的class definitions,如 Win32 Classes、WMI System Classes。
作為providers、management applications、WMI repository間的intermediary。
  • WMI consumers
WMI consumer:一個management的application或script,和WMI infrastructure作互動。能夠經由呼叫COM API for WMI 或Scripting API for WMI來query,、enumerate data和執行provider methods。

其他名詞解釋:

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

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

n   WMI Class
一種 managed object的template, 定義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 definitions。Class providers implement methods in the IWbemServices interface to support data retrieval, modification, deletion, enumeration, and query processing.

沒有留言:

張貼留言