2012-10-18 132 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 }