Issue with WMI SNMP Agent

  • Thread starter Thread starter Raja jayaraman
  • Start date Start date
R

Raja jayaraman

Hi
I have compiled RFC1155.mib(bridge.mib) file to mof file
and I have put that in the WBEM directory using mofcomp
utility.

Then I am trying to get the Forward Interface table from
Switch (i.e oid iso1).org(3).dod(6).internet(1).mgmt
(2).mib-2(1).dot1dBridge(17).dot1dTp(4).dot1dTpFdbTable
(3).dot1dTpFdbEntry(1) )

But If I tried to get continuesly .. the WMI is become
VERY slow.. after some time it looks like HUNG. WHY it is
happing like this?ONce I restart the WMI Service then it
is becoming normal for some time.


Following code to get the Forward table entries..
public void getFdTableEntries()
{

try

{

ManagementScope rMs = new ManagementScope
("root\\snmp\\localhost");

EnumerationOptions Enum_opts1 = new EnumerationOptions();

Enum_opts1 = Enum_opts;

string[] DesiredProperties =
{"dot1dTpFdbAddress","dot1dTpFdbPort"};

SelectQuery query = new SelectQuery
("SNMP_BRIDGE_MIB_dot1dTpFdbTable",null,DesiredProperties);
//,DesiredProperties);

ManagementObjectSearcher search = new
ManagementObjectSearcher(rMs,query,Enum_opts1);

search.Options.ReturnImmediately = true;

search.Options.EnumerateDeep = false;

foreach (ManagementBaseObject objSys in search.Get())

{

FwInterface ni = new FwInterface();

foreach (PropertyData Prop in objSys.Properties)

{

NumberFormatInfo provider = new NumberFormatInfo();

if(Prop.Name.Equals("dot1dTpFdbAddress"))

ni.MacInterface = Prop.Value.ToString();

if(Prop.Name.Equals("dot1dTpFdbPort"))

ni.SlotIndex = System.Convert.ToInt32(Prop.Value.ToString
(),provider);

}

this.nwl.Add(ni);

objSys.Dispose();

}

search.Dispose();

}

catch (ManagementException me)

{

throw new ManagementException(me.ToString());

}

catch (Exception e)

{

throw new Exception(e.ToString());

}

}







Regards
Raja
 
Back
Top