• Question

  • I have the WMI SNMP provider installed on XP W/SP2.  I encounter a "Provider
    not found" exception when I attempt to access the managed object in the
    foreach statements below.

    while trying the code given below i am getting an error "PROVIDER NOT FOUND" .


              ///sample code /// 

    System.Management.ManagementScope ms = new
    System.Management.ObjectQuery oq = new System.Management.ObjectQuery("SELECT
    * FROM SNMP_RFC1213_MIB_system");
    ManagementObjectSearcher query1 = new ManagementObjectSearcher(ms,oq);
    ManagementObjectCollection queryCollection1 = query1.Get();           
    foreach( ManagementObject mo in queryCollection1 )
    Console.WriteLine("Name : " + mo["sysContact"].ToString());


    I tried to solve the error by recompiling the mof files but its not working .I even tried the WMI diagnonsis tool for finding the root cause of the problem where i checked the namespace "ROOT\SNMP\SMIR" .There i got following warning:


    WARNING: WMI provider CIM registrations missing for the following provider(s): ..



    Even i rebuilt WMI repository but it is still not working. Can anyone tell me how to solve that error "PROVIDER NOT FOUND" and how to run that code without exception?. What i need to do for solving this warning ?


    Any help is appreciated.



    Friday, May 2, 2008 6:41 AM


All replies

  • Here is the solution for you at 'WMI Questions' part




    Friday, May 2, 2008 11:56 AM
  •  Not sure if you have found your answer. you should change to the following and this will clear your error provided you have successfully loaded the needed MIB.

    root\snmp\localhost - Will give correct results

    root\snmp\smir - will give you this error

    you can verify that the MIB is correctly loaded by doing the following from the command prompt:

    smi2smir /l

    this will give you a list of all your loaded mib's

    • Proposed as answer by colmite Monday, January 5, 2009 2:35 PM
    Monday, January 5, 2009 2:35 PM
  • Hello.

    I got the same problem, it's strange.
    I understood that we cannot call the SMIR namespace as it is just used to store the SNMP templates.

    However, when i connect to the "root\snmp\localhost" namespace, in the SNMP Macro i only see the RFC1213_MIB objects and none of the one i previously loaded !

    I can see them in "root\snmp\smir", they are dozens like "SNMP_Laserjet_Series4000_mib_prtalertentry", etc, etc.
    But none in the localhost namespace.

    I even did a "mofcomp -N:\root\snmp\localhost Laserjet.mof" to force the compilation into the specified namespace but no class are shown, isn't it strange ?

    So the problem is that whenever i load my script, i encounter a "invalid class error".

    Any help would be appreciated.
    Monday, November 2, 2009 9:21 AM
  • Hey Budykiller,


    I know its been a while. But did you manage to solve this problem that you mentioned above? because i have the EXACT SAME problem and donno what to do with it!!!!! Please help me out on this one.


    Thanks in advance,


    Tuesday, July 27, 2010 6:13 PM
  • Go to Properties of SNMP Windows Service.

    On security tab - check if the required community name is added

    Monday, January 3, 2011 10:11 AM