locked
Failed to convert MOF class RRS feed

  • Question

  • Hi All,

    I have an Issue with the SMS_DEF.MOF file failing to convert in the dataldr.log for SMS2003. When i parse the SMS_DEF.mof.it parses successfully using mofcomp -check.

    Attached are the details from the Dataldr.log

    Connected to SQL; waiting for Hinv action ID... SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:10 PM 5072 (0x13D0)

    Done with wait for Hinv action ID. SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:10 PM 5072 (0x13D0)

    Start of cimv2\sms-to-policy conversion SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:10 PM 5072 (0x13D0)

    Resetting SMS_Report qualifier to FALSE on all classes and properties in cimv2\sms namespace SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:10 PM 5072 (0x13D0)

    Running MOFCOMP on E:\SMS\inboxes\clifiles.src\hinv\sms_def.mof SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:10 PM 5072 (0x13D0)

    MofCompiler failed: SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:11 PM 5072 (0x13D0)

    error occurred while storing the data SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:11 PM 5072 (0x13D0)

    (80041001); ObjectNum=83, FirstLine=4124, LastLine=4132 SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:11 PM 5072 (0x13D0)

    BAD MOF backed up to E:\SMS\data\hinvarchive\sms_def.mof.bad.bak SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:11 PM 5072 (0x13D0)

    MOF restored from E:\SMS\data\hinvarchive\sms_def.mof.bak SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:11 PM 5072 (0x13D0)

    STATMSG: ID=2721 SEV=E LEV=M SOURCE="SMS Server" COMP="SMS_INVENTORY_DATA_LOADER" SYS=HPVISMSNT01 SITE=NT4 PID=7892 TID=5072 GMTDATE=Mon Jun 20 06:47:11.405 2011 ISTR0="E:\SMS\inboxes\clifiles.src\hinv\sms_def.mof" ISTR1="E:\SMS\data\hinvarchive\sms_def.mof.bad.bak" ISTR2="" ISTR3="" ISTR4="" ISTR5="" ISTR6="" ISTR7="" ISTR8="" ISTR9="" NUMATTRS=0 SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:11 PM 5072 (0x13D0)

    End of cimv2\sms-to-policy conversion; returning 0x80004005 SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:11 PM 5072 (0x13D0)

    Failed to convert MOF class/properties to policy; a retry will be attempted later... SMS_INVENTORY_DATA_LOADER 20/06/2011 4:47:11 PM 5072 (0x13D0)

    Tried looking at the lines that are bolded above where it appears the error have occurred.Posting a section of the MOF File where the error could be.Have bolded the lines starting from 4124 to 4132

    //==================================================================
    // Define registry classes for inventory reporting
    //
    // - Registry key/value class definition should be done in cimv2,
    // - SMS class definition should be done in cimv2\\sms
    //==================================================================

    //----------------------
    // Add Remove Programs
    //----------------------

    #pragma namespace ("\\\\.\\root\\cimv2")

    [ dynamic,
      provider("RegProv"),
      ClassContext("local|HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall")
    ]
    class Win32Reg_AddRemovePrograms
    {
        [key]     
            string    ProdID;
        [PropertyContext("DisplayName")]       
            string    DisplayName;
        [PropertyContext("InstallDate")]    
            string    InstallDate;
        [PropertyContext("Publisher")  ]       
            string    Publisher;
        [PropertyContext("DisplayVersion")]    
            string    Version;
    };


    #pragma namespace ("\\\\.\\root\\cimv2\\sms")

    [ SMS_Report     (TRUE),
      SMS_Group_Name ("Add Remove Programs"),
      SMS_Class_ID   ("MICROSOFT|ADD_REMOVE_PROGRAMS|1.0") ]
      Namespace      ("\\\\\\\\localhost\\\\root\\\\cimv2"),
      SMS_Context_1  ("__ProviderArchitecture=32|uint32"),
      SMS_Context_2  ("__RequiredArchitecture=true|boolean") ]

    class Win32Reg_AddRemovePrograms : SMS_Class_Template
    {
        [SMS_Report (TRUE), key ]  
            string ProdID;
        [SMS_Report (TRUE)      ]  
            string DisplayName;
        [SMS_Report (TRUE)      ]  
            string InstallDate;
        [SMS_Report (TRUE)      ]  
            string Publisher;
        [SMS_Report (TRUE)      ]  
            string Version;
    };

    #pragma namespace ("\\\\.\\root\\cimv2\\sms")

    [ SMS_Report     (FALSE),
      SMS_Group_Name ("Virtual Machine"),
      SMS_Class_ID   ("MICROSOFT|VIRTUAL_MACHINE|1.0") ]

    Line 4124

    class Win32Reg_SMSGuestVirtualMachine : SMS_Class_Template Line 4125
    {
        [SMS_Report (TRUE), key ]  
            string InstanceKey;
        [SMS_Report (TRUE)      ]  
            string PhysicalHostName;
        [SMS_Report (TRUE)      ]  
            string PhysicalHostNameFullyQualified;
    };

    //----------------------
    // Advanced Client Ports
    //----------------------

    #pragma namespace ("\\\\.\\root\\cimv2")

    [DYNPROPS

    [DYNPROPS]
    instance of Win32Reg_SMSAdvancedClientPorts
    {
        InstanceKey = "SMSPortKey";
        [PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\Microsoft\\CCM|HttpPort"),
                        Dynamic, Provider("RegPropProv")]
            PortName;
    };

    compared with some Mof files found on the web and could not find any difference.Please advice.

    Thanks

    Monday, June 20, 2011 12:53 PM

Answers

  • Have you resolved this yet?  If not, I think I see the issue.  You mention a KeyName in 1 section, but don't actually define it in the other 2 sections.  Try this one:

     

    //Server Uptime script //

    #pragma namespace ("\\\\.\\root\\cimv2")
    #pragma deleteclass("Uptime", NOFAIL)

    [DYNPROPS]

    Class Uptime

    {
    [key] string KeyName;
    String Availability;
    String TotalUptime;
    String TotalDowntime;
    String TotalReboots;
    String TotalBlueScreens;
    String TotalAppFailures;
    String TheDate;
    };

    [DYNPROPS]

    Instance of Uptime

    {
    KeyName="IgnoreThis";
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|Availability"),
      Dynamic,Provider("RegPropProv")] Availability;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalUptime"),
      Dynamic,Provider("RegPropProv")] TotalUptime;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalDowntime"),
      Dynamic,Provider("RegPropProv")] TotalDowntime;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalReboots"),
      Dynamic,Provider("RegPropProv")] TotalReboots;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalBlueScreens"),
      Dynamic,Provider("RegPropProv")] TotalBlueScreens;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalAppFailures"),
      Dynamic,Provider("RegPropProv")] TotalAppFailures;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TheDate"),
      Dynamic,Provider("RegPropProv")] TheDate;
    };

    #pragma namespace ("\\\\.\\root\\cimv2\\SMS")

    #pragma deleteclass("Uptime", NOFAIL)

    [SMS_Report(TRUE),
     SMS_Group_Name("Uptime"),
     SMS_Class_ID("APUptime|Uptime|1.0")]

    Class Uptime: SMS_Class_Template

    {
    [SMS_Report(TRUE),key] string KeyName;
    [SMS_Report(TRUE)] String Availability;
    [SMS_Report(TRUE)] String TotalUptime;
    [SMS_Report(TRUE)] String TotalDowntime;
    [SMS_Report(TRUE)] String TotalReboots;
    [SMS_Report(TRUE)] String TotalBlueScreens;
    [SMS_Report(TRUE)] String TotalAppFailures;
    [SMS_Report(TRUE)] String TheDate;
    };

     

    Slightly OT:  You know, this would have been so much easier if you just grab Mark Cochrane's RegkeytoMof 2.6, and used it to browse to the regkey branch of Software/Uptime, and copied/pasted the sms2003 sms_def.mof that he makes for you. 


    Standardize. Simplify. Automate.
    Wednesday, July 13, 2011 12:35 AM

All replies

  • #pragma namespace ("\\\\.\\root\\cimv2\\sms")

    [ SMS_Report     (FALSE),
      SMS_Group_Name ("Virtual Machine"),
      SMS_Class_ID   ("MICROSOFT|VIRTUAL_MACHINE|1.0") ]

    Line 4124

    class Win32Reg_SMSGuestVirtualMachine : SMS_Class_Template Line 4125
    {
        [SMS_Report (TRUE), key ]  
            string InstanceKey;
        [SMS_Report (TRUE)      ]  
            string PhysicalHostName;
        [SMS_Report (TRUE)      ]  
            string PhysicalHostNameFullyQualified;
    };

     


    Hi - Am not sure, why "#pragma namespace ("\\\\.\\root\\cimv2\\sms") [ SMS_Report (FALSE)]" is set false where the below entries "[SMS_Report (TRUE), key ]" is true ?

    Also, let us know the changes which you have made on SMS_Def.mof file. That may help.

     


    Anoop C Nair - This posting is provided "AS IS" with no warranties or guarantees, and confers no rights. |Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, June 22, 2011 5:24 AM
  • Hi Anoop,

    Thanks for the reply.I did a Mofcomp -class:forceupdate against the SMS_DEF.Mof to bypass the error above.

    Now however,it does not give me the details that have been added into the MOF File after a hardware inventory has been executed.

    CLASS - Process Class: Uptime Hardware Inventory Agent 29/06/2011 12:00:47 AM 322 (0x0142)
    INSTANCE WARNING - Failed to process instance of Uptime: 0x80041008 Hardware Inventory Agent 29/06/2011 12:00:47 AM 322 (0x0142)
    CLASS - End Class Enumeration. Next returned 0 objects: 0x1 Hardware Inventory Agent 29/06/2011 12:00:47 AM 322 (0x0142)

    These are the details of thechange to the MOFCOMP File for server uptime added below.

    //Server Uptime script //

    #pragma namespace ("\\\\.\\root\\cimv2")

    #pragma deleteclass("Uptime", NOFAIL)

    [DYNPROPS]

    Class Uptime

    {

    [key] string KeyName;

    String Availability;

    String TotalUptime;

    String TotalDowntime;

    String TotalReboots;

    String TotalBlueScreens;

    String TotalAppFailures;

    String Date;

    };

    [DYNPROPS]

    Instance of Uptime

    {

    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|Availability"),Dynamic,Provider("RegPropProv")] Availability;

    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalUptime"),Dynamic,Provider("RegPropProv")] TotalUptime;

    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalDowntime"),Dynamic,Provider("RegPropProv")] TotalDowntime;

    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalReboots"),Dynamic,Provider("RegPropProv")] TotalReboots;

    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalBlueScreens"),Dynamic,Provider("RegPropProv")] TotalBlueScreens;

    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalAppFailures"),Dynamic,Provider("RegPropProv")] TotalAppFailures;

    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|Date"),Dynamic,Provider("RegPropProv")] Date;

    };

    #pragma namespace ("\\\\.\\root\\cimv2\\SMS")

    #pragma deleteclass("Uptime", NOFAIL)

    [SMS_Report(TRUE),SMS_Group_Name("Uptime"),SMS_Class_ID("APUptime|Uptime|1.0")]

    Class Uptime: SMS_Class_Template

    {

    [SMS_Report(TRUE)] String Availability;

    [SMS_Report(TRUE)] String TotalUptime;

    [SMS_Report(TRUE)] String TotalDowntime;

    [SMS_Report(TRUE)] String TotalReboots;

    [SMS_Report(TRUE)] String TotalBlueScreens;

    [SMS_Report(TRUE)] String TotalAppFailures;

    [SMS_Report(TRUE)] String Date;

    };

     I checked on the server and the classess and Instance do exist.

    Tuesday, June 28, 2011 11:45 PM
  • INSTANCE WARNING - Failed to process instance of Uptime: 0x80041008 Hardware Inventory Agent 29/06/2011 12:00:47 AM 322 (0x0142)


    Hi - The error 0x80041008 translates INVALID PARAMETER

    See more details http://msdn.microsoft.com/en-us/library/aa394559(VS.85).aspx

    I still think, something to do with the WMI parameter

     


    Anoop C Nair - This posting is provided "AS IS" with no warranties or guarantees, and confers no rights. |Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, June 29, 2011 2:27 AM
  • Hi Anoop,

    Saw that previously but still could not drill down to which WMI parameter as they are all correct and it is the same parameters as the MOF file we are using in our SCCM environment.

    Forgot to mention,it was to capture NT4.0 Servers.

    Wednesday, June 29, 2011 3:30 AM
  •  it is the same parameters as the MOF file we are using in our SCCM environment.

    Forgot to mention,it was to capture NT4.0 Servers.

    Am sure, SCCM environment MOF files can't be used for NT4.0 Server.

    Anoop C Nair - This posting is provided "AS IS" with no warranties or guarantees, and confers no rights. |Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, June 29, 2011 4:41 AM
  • Just a random thought, it might be as simple as this.  Some words are reserved, like "Date".  It may be that it just simply doesn't like your label:

    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|Date"),Dynamic,Provider("RegPropProv")] Date;

    [SMS_Report(TRUE)] String Date;

     

    Change it to something like this (change Date to TheDate in all the relevant locations), and see if it takes it then, it's just a label, it doesn't have to match what is in the registry:

     

    String TheDate;


    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|Date"),Dynamic,Provider("RegPropProv")] TheDate;


    [SMS_Report(TRUE)] String TheDate;

     



    Standardize. Simplify. Automate.
    Thursday, June 30, 2011 4:39 PM
  • Hi Sherry,

    Have tried the above but it still comes back with the same error message in the hinv32.log

    CLASS - Process Class: Uptime Hardware Inventory Agent 4/07/2011 4:21:17 PM 224 (0x00E0)
    INSTANCE WARNING - Failed to process instance of Uptime: 0x80041008 Hardware Inventory Agent 4/07/2011 4:21:17 PM 224 (0x00E0)
    CLASS - End Class Enumeration. Next returned 0 objects: 0x1 Hardware Inventory Agent 4/07/2011 4:21:17 PM 224 (0x00E0)

    James

     

    Monday, July 4, 2011 6:23 AM
  • Have you resolved this yet?  If not, I think I see the issue.  You mention a KeyName in 1 section, but don't actually define it in the other 2 sections.  Try this one:

     

    //Server Uptime script //

    #pragma namespace ("\\\\.\\root\\cimv2")
    #pragma deleteclass("Uptime", NOFAIL)

    [DYNPROPS]

    Class Uptime

    {
    [key] string KeyName;
    String Availability;
    String TotalUptime;
    String TotalDowntime;
    String TotalReboots;
    String TotalBlueScreens;
    String TotalAppFailures;
    String TheDate;
    };

    [DYNPROPS]

    Instance of Uptime

    {
    KeyName="IgnoreThis";
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|Availability"),
      Dynamic,Provider("RegPropProv")] Availability;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalUptime"),
      Dynamic,Provider("RegPropProv")] TotalUptime;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalDowntime"),
      Dynamic,Provider("RegPropProv")] TotalDowntime;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalReboots"),
      Dynamic,Provider("RegPropProv")] TotalReboots;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalBlueScreens"),
      Dynamic,Provider("RegPropProv")] TotalBlueScreens;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TotalAppFailures"),
      Dynamic,Provider("RegPropProv")] TotalAppFailures;
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Uptime|TheDate"),
      Dynamic,Provider("RegPropProv")] TheDate;
    };

    #pragma namespace ("\\\\.\\root\\cimv2\\SMS")

    #pragma deleteclass("Uptime", NOFAIL)

    [SMS_Report(TRUE),
     SMS_Group_Name("Uptime"),
     SMS_Class_ID("APUptime|Uptime|1.0")]

    Class Uptime: SMS_Class_Template

    {
    [SMS_Report(TRUE),key] string KeyName;
    [SMS_Report(TRUE)] String Availability;
    [SMS_Report(TRUE)] String TotalUptime;
    [SMS_Report(TRUE)] String TotalDowntime;
    [SMS_Report(TRUE)] String TotalReboots;
    [SMS_Report(TRUE)] String TotalBlueScreens;
    [SMS_Report(TRUE)] String TotalAppFailures;
    [SMS_Report(TRUE)] String TheDate;
    };

     

    Slightly OT:  You know, this would have been so much easier if you just grab Mark Cochrane's RegkeytoMof 2.6, and used it to browse to the regkey branch of Software/Uptime, and copied/pasted the sms2003 sms_def.mof that he makes for you. 


    Standardize. Simplify. Automate.
    Wednesday, July 13, 2011 12:35 AM
  • Thanks Sherry,

    That resolved it.Will look at Mark Cochrane's RegkeytoMof 2.6 in future.

    Cheers

    Tuesday, July 19, 2011 6:20 AM