我在HOST-RESOURCES-MIB中设置了什么ProductID

时间:2016-12-29 14:57:50

标签: snmp mib opennms

我在python中实现SNMP代理并使用MIB HOST-RESOURCES-MIB。我需要设置的其中一个字段是hrSWRunID。此OID定义为ProductID类型,ProductID状态定义

  

ProductID :: = TEXTUAL-CONVENTION       状态当前       描述           "该文本惯例旨在识别

    manufacturer, model, and version of a specific
    hardware or software product.  It is suggested that
    these OBJECT IDENTIFIERs are allocated such that all
    products from a particular manufacturer are registered
    under a subtree distinct to that manufacturer.  In
    addition, all versions of a product should be
    registered under a subtree distinct to that product.
    With this strategy, a management station may uniquely
    determine the manufacturer and/or model of a product
    whose productID is unknown to the management station.
    Objects of this type may be useful for inventory
    purposes or for automatically detecting
    incompatibilities or version mismatches between
    various hardware and software components on a system.

    For example, the product ID for the ACME 4860 66MHz
    clock doubled processor might be:
    enterprises.acme.acmeProcessors.a4860DX2.MHz66

    A software product might be registered as:
    enterprises.acme.acmeOperatingSystems.acmeDOS.six(6).one(1)
    "
SYNTAX OBJECT IDENTIFIER
     

- unknownProduct将用于任何未知的ProductID    - unknownProduct OBJECT IDENTIFIER :: = {0 0}

由此我假设值com.mycompany.mydepartment.myapp.appversion就足够了,但是当我运行代码时它失败并出现错误ProductID: invalid literal for int() with base 0: 'com'\n"]

通过一些实验,我终于设法运行我的代码,并将ProductID设置为一组数字,例如{1, 2, 3}。虽然我的代码现在有效,但我没有更清楚正确的值应该是什么是。

任何人都可以了解ProductID是或应该是什么?

1 个答案:

答案 0 :(得分:1)

ProductID将是定义的MIB对象的OBJECT IDENTIFIER 在您的企业MIB下。一个好的开始就是让它变得一样 系统组的sysObjectID。