【发布时间】:2016-12-29 14:57:49
【问题描述】:
我正在 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 -- 未知产品对象标识符 ::= { 0 0 }
据此,我假设 com.mycompany.mydepartment.myapp.appversion 的值就足够了,但是当我运行代码时它失败并出现错误 ProductID: invalid literal for int() with base 0: 'com'\n"]
经过一些实验,我终于设法运行我的代码,并将 ProductID 设置为一组数字,例如{1, 2, 3}。虽然我的代码现在可以工作,但我不清楚正确的值应该是什么。
谁能解释一下 ProductID 是什么或应该是什么?
【问题讨论】: