简体   繁体   English

动态遍历MIB以查找OID以提取信息

[英]Dynamically traversing MIB to find OIDs to extract information

I am currently attempting to pull specific information from the MIBs of a couple of devices. 我目前正在尝试从几个设备的MIB中提取特定信息。

These will mainly be Cisco devices, I was wondering if there were any common OIDs for all devices I can query from, or would they need to be individually hard coded in a config file? 这些主要是思科设备,我想知道是否可以查询所有设备的通用OID,还是需要在配置文件中单独对其进行硬编码? Or maybe anyway I can dynamically search for these OIDs? 还是无论如何,我都可以动态搜索这些OID?

Correct me if I am wrong, but to my understanding, the MIB set for each device type is different and there are very few common elements within them, most of which will be manufacturer specific? 如果我错了,请纠正我,但是据我了解,每种设备类型的MIB设置都不同,并且其中几乎没有相同的元素,其中大多数是特定于制造商的吗?

I am trying to retrieve things like 我正在尝试检索类似的东西

  • CPU usage CPU使用率
  • HDD free space 硬盘可用空间
  • uptime 运行时间
  • etc... 等等...

Yes, all devices implement different sets of MIBs. 是的,所有设备都实现不同的MIB集。 However, many devices will implement the same standard MIBs, so there may be common variables that you could poll from all of them, particularly if they're from a single vendor. 但是,许多设备将实现相同的标准MIB,因此您可能会从所有设备中轮询某些公共变量,尤其是如果它们来自单个供应商时。

There are two fairly straighforward ways to find out the MIB set implemented by a device: 有两种相当简单的方法来找出设备实现的MIB集:

  1. SNMP walk it and compare the output SNMP遍历并比较输出
  2. Ask the vendors/documentation about which MIBs are implemented. 向供应商/文档询问实施了哪些MIB。

Some devices also store the MIB files on their file system, making it possible to fetch the canonical list from there, but that's not applicable in 100% of the cases. 某些设备还将MIB文件存储在其文件系统上,从而可以从此处获取规范列表,但这不适用于100%的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM