chg008
驱动牛犊
驱动牛犊
  • 注册日期2007-08-27
  • 最后登录2007-10-10
  • 粉丝0
  • 关注0
  • 积分20分
  • 威望3点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
阅读:3251回复:3

求助:WMI 如何列举所有snmp的MIB表的内容?

楼主#
更多 发布于:2007-08-27 17:42
求教:网上资料比较匮乏,请教各位大侠!

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\snmp\localhost")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM SNMP_RFC1213_MIB_ifTable", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

例如上面的VB代码只能列举mib表ifTable部分的内容,如何把该MIB表的所有内容列举出来呢?

目的:需要读出ADSL modem的参数内容。不是标准的位置。

位置: http://support.ipmonitor.com/mibs/ADSL-LINE-MIB/item.aspx?id=adslAtucChanCurrTxRate

ADSL-LINE-MIB :: adslAtucChanCurrTxRate
Name: adslAtucChanCurrTxRate
Oid: 1.3.6.1.2.1.10.94.1.1.4.1.2
Path: iso . org . dod . internet . mgmt . mib-2 . transmission . adslMIB . adslLineMib . adslMibObjects . adslAtucChanTable . adslAtucChanEntry . adslAtucChanCurrTxRate
Type Gauge32
Value-Ranges  0 to 4294967295
Access read-only
Status current
Description

--------------------------------------------------------------------------------

Actual transmit rate on this channel.
cswang
驱动小牛
驱动小牛
  • 注册日期2001-11-05
  • 最后登录2010-03-01
  • 粉丝0
  • 关注0
  • 积分1004分
  • 威望144点
  • 贡献值0点
  • 好评度96点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-09-04 14:46
你应该找到你索要查询的MIB名称(ADSL-LINE-MIB )在WMI中对应的名称,就像你的例子中所写的那样,ifTable在WMI中对应的是SNMP_RFC1213_MIB_ifTable一样,然后再根据这个名称来查询具体的内容了
瞬息不可挽救,永恒不可企及
cswang
驱动小牛
驱动小牛
  • 注册日期2001-11-05
  • 最后登录2010-03-01
  • 粉丝0
  • 关注0
  • 积分1004分
  • 威望144点
  • 贡献值0点
  • 好评度96点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2007-09-04 14:48
Miscrosoft的MSDNS上有说明如何将MIB名称转换CIM类:
The following rules apply when mapping SNMP collections to CIM classes. Unless otherwise specified, these rules apply to both scalar and table collections:


The mapping process generates CIM class names by concatenating "SNMP_", the MIB module identity name, "_", and the collection's object descriptor.
For example: system translates to SNMP_RFC1213_MIB_system, while ifTable translates to SNMP_RFC1213_MIB_ifTable.

In all cases, hyphens (-) in SNMP MIB identifiers map to underscores (_) in CIM class names.
Naming conflicts can occur due to CIM name case-insensitivity. If a naming conflict occurs, the provider chooses one of the conflicting group definitions and ignores the remaining definitions.
The identity name of the MIB module that contains the collection maps to the CIM class qualifier Module_Name.
The object identifier of the fabricated collection maps to the CIM class qualifier Group_Objectid.
The MIB module imports list (obtained from the MODULE-IDENTITY macro definition) maps to the CIM class qualifier module_imports. This qualifier contains a comma-separated list of module names.
瞬息不可挽救,永恒不可企及
chg008
驱动牛犊
驱动牛犊
  • 注册日期2007-08-27
  • 最后登录2007-10-10
  • 粉丝0
  • 关注0
  • 积分20分
  • 威望3点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
地板#
发布于:2007-09-24 13:54
谢谢回复,我用winsnmp 的api能完成此目的;我再用wmi试试!
游客

返回顶部