2016-12-29 153 views
0

我在python中实现SNMP代理,并使用MIB HOST-RESOURCES-MIB。我需要设置的字段之一是hrSWRunID。该OID被定义为ProductID类型和定义的用于ProductID状态什么我设置ProductID到HOST-RESOURCES-MIB

的ProductID :: = TEXTUAL-公约 当前状态 说明 “这个文本的约定旨在标识

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 

- 未知产品将用于任何未知产品ID - 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

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

+0

OK。这是有道理的。在许多情况下,我正在为使用OpenNMS监视的python应用程序编写代码,因此我没有企业MIB。 –

+1

在这种情况下,请使用unknownProduct,或使用任何其他OID。管理应用程序想要解析名称,并可以为已知的ProductID启用某些功能。 –

相关问题