0
IONLINE-MIB DEFINITIONS ::= BEGIN

IMPORTS
    IpAddress,
    MODULE-IDENTITY,
    OBJECT-TYPE,
    NOTIFICATION-TYPE,
    snmpModules,
    OBJECT-IDENTITY,
    enterprises,
    Counter32,
    Integer32
        FROM SNMPv2-SMI
    DisplayString,
    TEXTUAL-CONVENTION,
    TruthValue,
    DateAndTime
        FROM SNMPv2-TC;


elite   MODULE-IDENTITY
      LAST-UPDATED  "201208220000Z"
      ORGANIZATION  "E Technologies"
      CONTACT-INFO
                        "
                        Postal: XXX
                        E-mail: i@o.c
                        "
      DESCRIPTION
                        "
                        This MIB module defines MIB objects which provide
                            mechanisms to remotely configure the parameters used
                            by 24Online Agent for the generation of SNMP messages.
                        "
    ::= { enterprises 21068 }


ionline OBJECT-IDENTITY
    STATUS          current
    DESCRIPTION ""
    ::= { elite 3 }

-- Enumerations used in 24online system


-- 24online
onSystem        OBJECT IDENTIFIER ::= { ionline 1 }

-- 24online.system
sysStatus       OBJECT IDENTIFIER ::= { onSystem 1 }

-- onSystem.sysInstall

poolStatus      OBJECT IDENTIFIER ::= { sysStatus 3 }

poolUsage  OBJECT-TYPE
    SYNTAX          Counter32
    MAX-ACCESS      read-only
    STATUS          current
    DESCRIPTION     "% pool usage"
    ::= { poolStatus 1 }
END

以上是我的标量对象的示例 MIB 文件.. poolUsage 是单个 OID 的存储...我想将它添加为一个表,我可以分配诸如 poolUsage.1、poolUsage.2 等的值。我想要将此标量转换为“表格”格式...我应该做哪些更改?请帮我。

4

2 回答 2

2

请参阅本教程。我认为这正是您所需要的。

它的要点转载如下:

batteryTable OBJECT-TYPE
    SYNTAX     SEQUENCE OF BatteryEntry
    MAX-ACCESS not-accessible
    STATUS     current
    DESCRIPTION
        "The (conceptual) table of batteries contained by the
        module."
    ::= { monitor 1 }

batteryEntry OBJECT-TYPE
    SYNTAX     BatteryEntry
    MAX-ACCESS not-accessible
    STATUS     current
    DESCRIPTION
        "A (conceptual) entry for one battery contained by
        the module.  The batteryIndex in the index represents
        the entry in the batteryTable that corresponds to the
        batteryEntry.

        As an example of how objects in this table are named,
        an instance of the batteryVoltage object might be
        named batteryVoltage.3"
    INDEX { batteryIndex }
    ::= { batteryTable 1 }

batteryIndex OBJECT-TYPE
    SYNTAX      DeviceIndex
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
            "A unique value, greater than zero, for each battery. 
            It is recommended that values are assigned contiguously
            starting from 1."
    ::= { batteryEntry 1 }

batteryVoltage    OBJECT-TYPE 
   SYNTAX Integer32 
   ACCESS read-only 
   STATUS current 
   DESCRIPTION 
      "Voltage A/D value" 
   ::= { batteryEntry 2 }
于 2013-05-14T14:45:47.397 回答
0

如果你需要写任何复杂的东西,我强烈建议你买一本关于 MIB 的书。这是一种“有趣”的语言,如果你在写东西时能正确使用它会更好......

但是,您至少应该阅读描述该语言的RFC2578 (但是比教程更正式)。您还可以查看一个示例,例如RFC2863:IF-MIB,其中包含一个简单的表 ( ifTable),其结构可以复制。

于 2012-10-18T14:19:38.397 回答