SNMP MIB庫


-- mib文件的開頭指定文件名,並且使用BEGIN開始,文件的最后用END結束
-- IMPORTS就相當與c語言中的include,包含需要使用的一些數據類型
-- 通過FROM指定引用的來源
MOXA-CN2600-MIB DEFINITIONS ::= BEGIN
    IMPORTS
        enterprises,
        IpAddress,
        OBJECT-TYPE            FROM SNMPv2-SMI
        DateAndTime,
        TEXTUAL-CONVENTION,
        MacAddress,
        DisplayString         FROM SNMPv2-TC;

-- 不同的公司在enterprises節點下注冊注冊自己的id,moxa的節點是8691
-- 使用OBJECT IDENTIFIER指定OID
    moxa                 OBJECT IDENTIFIER ::= { enterprises 8691 }    -- 1.3.6.1.4.1.8691
-- 指定nport串口服務器是在moxa節點下的分支,id是2
-- oid:  1.3.6.1.4.1.8691.2
    nport OBJECT IDENTIFIER ::= { moxa 2 }            -- 1.3.6.1.4.1.8691.2
-- 產品型號cn2600,是在nport串口服務器分支下,節點是11
-- oid:  1.3.6.1.4.1.8691.2.11
    cn2600   MODULE-IDENTITY
        LAST-UPDATED "201003040000Z"
        ORGANIZATION "Moxa Inc."
        CONTACT-INFO
                "Email: support@moxa.com
                 Tel  : +886 2 89191230 ext.300"
                 
        DESCRIPTION
                "The MIB module for Moxa Terminal Server CN2600 series specific information."            
    
        ::= { nport 11 }    -- 1.3.6.1.4.1.8691.2.11
    
-- -------------------------------------------------------------
-- groups in the MOXA-CN2600-2AC MIB
-- -------------------------------------------------------------

swMgmt        OBJECT IDENTIFIER ::= { cn2600 1 }            -- 1.3.6.1.4.1.8691.2.11.1    

-- -------------------------------------------------------------
-- Textual Conventions
-- -------------------------------------------------------------

PortList ::= TEXTUAL-CONVENTION
    STATUS            current
    DESCRIPTION        
        "Each octet within this value specifies a set of eight
        ports, with the first octet specifying ports 1 through
        8, the second octet specifying ports 9 through 16, etc.
        Within each octet, the most significant bit represents
        the lowest numbered port, and the least significant bit
        represents the highest numbered port.  Thus, each port
        of the bridge is represented by a single bit within the
        value of this object.  If that bit has a value of '1'
        then that port is included in the set of ports; the port
        is not included if its bit has a value of '0'."
    SYNTAX      OCTET STRING
    
-- -------------------------------------------------------------
-- swMgmt group
-- -------------------------------------------------------------

-- -------------------------------------------------------------
-- Overview
-- -------------------------------------------------------------

    overview OBJECT IDENTIFIER ::= { swMgmt 1 }        -- 1.3.6.1.4.1.8691.2.11.1.1
-- 模塊名稱
-- 類型:DisplayString,類似字符串
-- 訪問權限:只讀
-- 狀態:當前
-- id: overview 1
-- 1.3.6.1.4.1.8691.2.11.1.1.1
    modelName OBJECT-TYPE
        SYNTAX DisplayString
        MAX-ACCESS read-only
        STATUS current
        DESCRIPTION
            "The model name of the CN2600."
        ::= { overview 1 }                            -- 1.3.6.1.4.1.8691.2.11.1.1.1
-- 數據類型:整型
    serialNumber OBJECT-TYPE
        SYNTAX INTEGER
        MAX-ACCESS read-only
        STATUS current
        DESCRIPTION
            "The serial number of the CN2600. Every Terminal Server CN2600
            series is assigned a unique serial
            number before it is shipped."
        ::= { overview 2 }
    
    firmwareVersion OBJECT-TYPE
        SYNTAX DisplayString
        MAX-ACCESS read-only                
        STATUS current
        DESCRIPTION
            "The version of the firmware currently running on the CN2600."
        ::= { overview 3 }
-- 類型:ip地址
    viewLan1IpAddress OBJECT-TYPE
        SYNTAX IpAddress
        MAX-ACCESS read-only               
        STATUS current
        DESCRIPTION
            "The IP address of the CN2600's LAN1 interface."
        ::= { overview 4 }
-- 類型:mac地址
    viewLan1MacAddress OBJECT-TYPE
        SYNTAX MacAddress
        MAX-ACCESS read-only               
        STATUS current
        DESCRIPTION
            "The MAC address of the CN2600's LAN1 interface."
        ::= { overview 5 }

-- 省略其中的一些。。。。。

-- 可以指定整型的范圍之后0,1兩個值,類似枚舉
-- 前面的"power-off","power-on"用於描述
    power1Status  OBJECT-TYPE
        SYNTAX INTEGER {
            power-off(0),
            power-on(1)
        }
        MAX-ACCESS read-only
        STATUS current
        DESCRIPTION
            "The on/off status of power 1"
        ::= { overview 11 }

    power2Status  OBJECT-TYPE
        SYNTAX INTEGER {
            power-off(0),
            power-on(1)
        }
        MAX-ACCESS read-only
        STATUS current
        DESCRIPTION
            "The on/off status of power 2 for 2AC model"
        ::= { overview 12 }

-- -------------------------------------------------------------
-- Basic settings
-- -------------------------------------------------------------

    basicSetting OBJECT IDENTIFIER ::= { swMgmt 2}            -- 1.3.6.1.4.1.8691.2.11.1.2

-- -------------------------------------------------------------
-- Basic settings -> Server settings
-- -------------------------------------------------------------
    
    serverSetting OBJECT IDENTIFIER ::= { basicSetting 1 }    -- 1.3.6.1.4.1.8691.2.11.1.2.1
    
    serverName OBJECT-TYPE
        SYNTAX DisplayString
        MAX-ACCESS read-write                
        STATUS current
        DESCRIPTION
            "A text string used to identify the CN2600."
        ::= { serverSetting 1 }
       
    serverLocation OBJECT-TYPE
        SYNTAX DisplayString
        MAX-ACCESS read-write                
        STATUS current
        DESCRIPTION
            "A text string used to identify the location of the CN2600. This
            option is useful for specifying the location or
            application of different CN2600."
        ::= { serverSetting 2 }
        
-- -------------------------------------------------------------
-- Basic settings -> Time settings
-- -------------------------------------------------------------
    
    timeSetting OBJECT IDENTIFIER ::= { basicSetting 2 }    -- 1.3.6.1.4.1.8691.2.11.1.2.2
-- 時間設置,可以進行讀寫    
    timeZone OBJECT-TYPE
        SYNTAX INTEGER
        MAX-ACCESS read-write                
        STATUS current
        DESCRIPTION
            "The time-zone index of the CN2600."
        ::= { timeSetting 1 }
    
    localTime OBJECT-TYPE
        SYNTAX DateAndTime
        MAX-ACCESS read-write               
        STATUS current
        DESCRIPTION
            "The system time in seconds since 1970/1/1."
        ::= { timeSetting 2 }

-- -------------------------------------------------------------
-- Serial port settings
-- -------------------------------------------------------------

    portSetting OBJECT IDENTIFIER ::= { swMgmt 4 }            -- 1.3.6.1.4.1.8691.2.11.1.2.4
    
-- -------------------------------------------------------------
-- Serial port settings -> Operation Modes settings
-- -------------------------------------------------------------

    opModeSetting OBJECT IDENTIFIER ::= { portSetting 1 }    -- 1.3.6.1.4.1.8691.2.11.1.2.4.1
    
-- --------------------------------------------------------------------------------------
-- Serial port settings -> Operation Modes settings -> Operation Modes
-- --------------------------------------------------------------------------------------

    opMode OBJECT IDENTIFIER ::= { opModeSetting 1 }        -- 1.3.6.1.4.1.8691.2.11.1.2.4.1.1
-- 表類型的定義    
-- 使用SEQUENCE OF定義一種新的類型OpModePortEntry
-- 有點像C語言中結構體的定義
-- opModePortTable是表名,開頭必須小寫,並且結尾必須包含"Table"
-- 1.3.6.1.4.1.8691.2.11.1.2.4.1.1.1
    opModePortTable OBJECT-TYPE
        SYNTAX SEQUENCE OF OpModePortEntry
        MAX-ACCESS not-accessible               
        STATUS current
        DESCRIPTION
            "The serial ports' operation mode table."
        ::= { opMode 1 }
-- 表中一行的名稱:opModePortEntry,每行數據的數據類型是一樣的
-- 類型是:OpModePortEntry
-- 1.3.6.1.4.1.8691.2.11.1.2.4.1.1.1.1
-- 表中第一個必須是INDEX,作為索引,並且是不可訪問的。
    opModePortEntry OBJECT-TYPE
        SYNTAX OpModePortEntry
        MAX-ACCESS not-accessible               
        STATUS current
        DESCRIPTION
            "The serial port's operation mode entry."
        INDEX { portIndex }
        ::= { opModePortTable 1 }

-- 表中數據類型 ,類似結構體定義,並且第一個是INDEX
-- 一行中,每一列的數據類型定義如下
-- INDEX如果前面定義了,就說使用前面一個表的索引,那么這里也可以省略
    OpModePortEntry ::=
        SEQUENCE {
            portIndex
                INTEGER,
            portApplication
                INTEGER,
            portMode
                INTEGER
        }
-- 對索引的定義,權限不可訪問,里面沒有數據,所以訪問也沒有意義
-- 1.3.6.1.4.1.8691.2.11.1.2.4.1.1.1.1.1
-- 在一行opModePortEntry中,第一個元素
    portIndex OBJECT-TYPE
        SYNTAX INTEGER
        MAX-ACCESS read-only                
        STATUS current
        DESCRIPTION
            "The serial port index."
        ::= { opModePortEntry 1 }

-- 表中一行中第二個元素的定義
-- 1.3.6.1.4.1.8691.2.11.1.2.4.1.1.1.1.2
    portApplication OBJECT-TYPE
        SYNTAX INTEGER {
            disable(0),
            device-Control(4),
            socket(11),
            redundant-Com(5),
            drdas(9),
            terminal(2),
            reverse-Terminal(3),               
            dial-InOut(1)
        }
        MAX-ACCESS read-write                
        STATUS current
        DESCRIPTION
            "The application of the serial port.
            Note that changing this setting may also change the
            operation mode."
        ::= { opModePortEntry 2 }
    
-- 1.3.6.1.4.1.8691.2.11.1.2.4.1.1.1.1.3
    portMode OBJECT-TYPE
        SYNTAX INTEGER {  
            real-Com(2),
            slip(4),
            slipd(5),
            ppp(6),
            disable(7),
            telnetd(8),
            dynamic(9),
            tcp-Server(10),
            tcp-Client(13),
            udp(14),
            pppd(15),
            term-ASC(16),
            term-BIN(17),
            rfc-2217(20),
            redundant-Com(22),
            drdas-Real-Com(23),
            drdas-Tcp-Server(24),
        }
        MAX-ACCESS read-write                
        STATUS current
        DESCRIPTION
            "The operation mode of the serial port. Note that
            changing this setting may also change the application."
        ::= { opModePortEntry 3 }
        
END

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM