0

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

ProductID ::= TEXTUAL-CONVENTION STATUS current DESCRIPTION “此文本约定旨在识别

    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 是什么或应该是什么?

4

1 回答 1

1

ProductID 将是在您的企业 MIB 下定义的 MIB 对象的 OBJECT IDENTIFIER。一个好的开始是使其与系统组的 sysObjectID 相同。

于 2016-12-29T15:13:53.610 回答