Setting Up the DMI Provider

[This is preliminary documentation and subject to change.]

    To set up the DMI provider
  1. Create a MOF file.
  2. Create the \DmiNodes namespace. To create a namespace, create an instance of the __NAMESPACE class. The \DmiNodes namespace must reside in the \Root namespace:
    #pragma namespace("\\\\.\\root") 
    instance of __Namespace 
    {
    Name = "DmiNodes";
    };
    
  3. Create a namespace for each managed node under DmiNodes. Each namespace representing a DMI node must include a class and an instance that describes the node, as well as instances of the required provider registration class.
    #pragma namespace("\\\\.\\root\\DmiNodes")
    instance of __NameSpace
    {
    Name = "ManagedNode1";    // Logical name given to a 
    // remote node
    };
    
  4. Create the class DmiNode. This class must have the qualifier singleton and the string property called "NetworkAddress":
    [singleton]
    class DmiNode
    {
    string NetworkAddress;
    };
    
  5. Create an instance of DmiNode. Set the NetworkAddress property to the network name or address of the managed node:
    instance of DmiNode
    {
    // Network address for ManagedNode1 or its machine name
    NetworkAddress = "206.170.168.35"    
    };
    
  6. Create an instance of __Win32Provider to register the DMI provider to handle class and instance operations for the node created above:
    #pragma namespace("\\\\.\\root\\DmiNodes\\ManagedNode1")
    instance of __Win32Provider As $Provider
    {
    Name = "WbemDmip" ;    // Provider DLL name
    ClsId = "{DE065A70-19B5-11D1-B30C-00609778D668}" ;
    };
    
  7. Create an instance of __InstanceProviderRegistration to tell the Common Information Model Object Manager (CIMOM) that the provider supports instance operations:
    {
    Provider = $Provider;
    SupportsGet = TRUE;
    SupportsPut = TRUE;
    SupportsDelete = TRUE;
    SupportsEnumeration = TRUE;
    };
    
  8. Create an instance of __MethodProviderRegistration to tell CIMOM that the provider handles methods:
    instance of __MethodProviderRegistration
    {
        Provider = $Provider;
    };
    
  9. Create an instance of __ClassProviderRegistration to tell CIMOM that the provider supports class operations:
    instance of __ClassProviderRegistration
    {
      Provider = $Provider;
      SupportsGet = TRUE;
      SupportsPut = FALSE;
      SupportsDelete = TRUE;
      SupportsEnumeration = TRUE;
      QuerySupportLevels = NULL ;
    ResultSetQueries = { 
    "Select * From meta_class Where __this isa \"DmiComponent\"" ,
    "Select * From meta_class Where __this isa   \"DmiGroupRoot\"" ,
    "Select * From meta_class Where __this isa \"DmiBindingRoot\"" ,
    "Select * From meta_class Where __this isa \"DmiNodeData\"" ,
    "Select * From meta_class Where __this isa \"DmiLanguage\"" ,
    "Select * From meta_class Where __this isa \"DmiEvent\"" ,
    "Select * From meta_class Where __this isa \"DmiAddMethodParams\"" ,
    "Select * From meta_class Where __this isa \"DmiGetEnumParams\"" ,
    "Select * From meta_class Where __this isa \"DmiLanguageMethodsParams\"" 
    } ;
    } ;
    };
    
  10. Create an instance of __Win32Provider to tell CIMOM that the provider supports events:
    instance of __Win32Provider as $EventProv
    {
        Name = "WbemDmiEventp" ;
        ClsId =  "{B21FBFA0-1B39-11d1-B317-00609778D668}";
    };
    
  11. Create an instance of __EventProviderRegistration to tell CIMOM the types of events that the provider can handle:
    Instance of __EventProviderRegistration
    {
     Provider = "WbemDmiEventp";
     EventQueryList = {
      "select * from DmiEvent",
    "select * from __InstanceCreationEvent where TargetInstance is a \"DmiComponent\"",
    "select * from __InstanceDeletionEvent where TargetInstance is a \"DmiComponent\"",
    "select * from __InstanceCreationEvent where TargetInstance is a \"DmiLanguage\"",
    "select * from __InstanceDeletionEvent where TargetInstance is a \"DmiLanguage\""
    "select * from __ClassCreationEvent where TargetInstance is a \"DmiGroupRoot\""
    "select * from __ClassDeletionEvent where TargetInstance is a \"DmiGroupRoot\""
    
     };
    };
    

    Alternately, you can use the WBEM Developer Studio to create namespaces and the required class and instance definitions. For instructions, see the WBEM SDK Applications Guide for instructions. See the sample MOF file WBEMDMIP.MOF included with the WBEM SDK.

  12. After you create a MOF for a managed node, you must submit the file to WBEM's MOF compiler.
    mofcomp  <MOF-file>