2012-10-18 136 views
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: [email protected] 
         " 
     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等等。 我想将此标量转换为“表格”格式... 我应该做什么改变?请帮帮我。MIB文件写入问题

回答

0

如果你需要写任何复杂的东西,我强烈建议你写一本关于MIB的书。这是一种“有趣的”语言,如果你在写东西的时候做得对,它会更好。

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

2

请参阅this tutorial。我认为这正是你需要的。

它的要领转载如下:

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 }