--
-- %CopyrightBegin%
-- 
-- Copyright Ericsson AB 1996-2009. All Rights Reserved.
-- 
-- The contents of this file are subject to the Erlang Public License,
-- Version 1.1, (the "License"); you may not use this file except in
-- compliance with the License. You should have received a copy of the
-- Erlang Public License along with this software. If not, it can be
-- retrieved online at http://www.erlang.org/.
-- 
-- Software distributed under the License is distributed on an "AS IS"
-- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-- the License for the specific language governing rights and limitations
-- under the License.
-- 
-- %CopyrightEnd%
--

OTP-MIB DEFINITIONS ::= BEGIN
 
IMPORTS
    OBJECT-TYPE
        FROM RFC-1212
    Counter64
        FROM SNMPv2-SMI
    Gauge
        FROM RFC1155-SMI
    DisplayString
        FROM RFC1213-MIB
    otpModules
        FROM OTP-REG
    otpApplications
        FROM OTP-REG
    ;

-- otpModule MODULE-IDENTITY
--     LAST-UPDATED    "201307160700Z"
--     ORGANIZATION    "Ericsson"
--     CONTACT-INFO
--         "Contact:    Erlang Support see license agreement for Erlang/OTP."
--     DESCRIPTION
--         "This is a MIB for a distributed OTP system, with one SNMP
--         agent executing at one node only.  Each Erlang node in the
--         OTP system is represented by one row in the erlNodeTable."
-- 
--     REVISION        "201307160700Z"
--     DESCRIPTION
--         "Updated various types to be able to reflect larger values.
--         The objects erlNodeReductions, erlNodeInBytes, erlNodeOutBytes as well
--         as the type MilliSeconds have been updated to Counter64."
-- 
--     REVISION        "200305090900Z"
--     DESCRIPTION
--         "Changed CONTACT-INFO as it was outdated, made it more generic
-- 	to avoid such changes in the future."
--     
--     REVISION        "199712010900Z"
--     DESCRIPTION
--         "Converted to v2 SMI and placed in the OTP tree."
-- 
--     REVISION        "199608191700Z"
--     DESCRIPTION
--         "The initial revision of MIB module OTP-MIB."
-- 
--     ::= { otpModules 3 }

otpMIB          OBJECT IDENTIFIER ::= { otpApplications 1 }
otpMIBConformance
                OBJECT IDENTIFIER ::= { otpMIB 1 }
otpMIBObjects   OBJECT IDENTIFIER ::= { otpMIB 2 }

-- Datatypes

MilliSeconds ::=
--TEXTUAL-CONVENTION
--     STATUS      mandatory
--     DESCRIPTION
--         "The MilliSeconds type represents a Counter which represents
--         the time, in milliseconds between two epochs.  When objects
-- 	are defined which use this type, the description of the object
-- 	identifies both of the reference epochs."
--SYNTAX

Counter64


-- Managed Objects

erlang          OBJECT IDENTIFIER ::= { otpMIBObjects 1 }
appls           OBJECT IDENTIFIER ::= { otpMIBObjects 2 }

erlNodeTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF ErlNodeEntry
    ACCESS      not-accessible
    STATUS      mandatory
    DESCRIPTION
        "A table with info on each erlang node in the system."
    ::= { erlang 1 }

erlNodeEntry OBJECT-TYPE
    SYNTAX      ErlNodeEntry
    ACCESS      not-accessible
    STATUS      mandatory
    DESCRIPTION
        "A conceptual row in the erlNodeTable."
    INDEX   { erlNodeId }
    ::= { erlNodeTable 1 }

ErlNodeEntry ::= SEQUENCE {
    erlNodeId           INTEGER,
    erlNodeName         DisplayString,
    erlNodeMachine      DisplayString,      
    erlNodeVersion      DisplayString,
    erlNodeRunQueue     Gauge,
    erlNodeRunTime      MilliSeconds,
    erlNodeWallClock    MilliSeconds,
    erlNodeReductions   Counter64,
    erlNodeProcesses    Gauge,
    erlNodeInBytes      Counter64,
    erlNodeOutBytes     Counter64
}

erlNodeId OBJECT-TYPE
    SYNTAX      INTEGER
    ACCESS      not-accessible
    STATUS      mandatory
    DESCRIPTION
        "An integer that uniquely identifies the erlang node."
    ::= { erlNodeEntry 1 }

erlNodeName OBJECT-TYPE
    SYNTAX      DisplayString
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "The symbolic name of the erlang node."
    ::= { erlNodeEntry 2 }

erlNodeMachine OBJECT-TYPE
    SYNTAX      DisplayString
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "The virtual machine executing the erlang node"
    ::= { erlNodeEntry 3 }

erlNodeVersion OBJECT-TYPE
    SYNTAX      DisplayString
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "The version number of the virtual machine"
    ::= { erlNodeEntry 4 }

erlNodeRunQueue OBJECT-TYPE
    SYNTAX      Gauge
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "Number of processes scheduled to run"
    ::= { erlNodeEntry 5 }

erlNodeRunTime OBJECT-TYPE
    SYNTAX      MilliSeconds
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "Total cpu time in milliseconds since the 
        system started"
    ::= { erlNodeEntry 6 }

erlNodeWallClock OBJECT-TYPE
    SYNTAX      MilliSeconds
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "Total real time in milliseconds since the 
        system started"
    ::= { erlNodeEntry 7 }  

erlNodeReductions OBJECT-TYPE
    SYNTAX      Counter64
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "Number of function calls since the system started"
    ::= { erlNodeEntry 8 }

erlNodeProcesses OBJECT-TYPE
    SYNTAX      Gauge
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "Number of running processes in the system."
    ::= { erlNodeEntry 9 }

erlNodeInBytes  OBJECT-TYPE
    SYNTAX      Counter64
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "The total number of bytes delivered to the system"
    ::= { erlNodeEntry 10 }

erlNodeOutBytes  OBJECT-TYPE
    SYNTAX      Counter64
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "The total number of bytes delivered from the system"
    ::= { erlNodeEntry 11 }


applTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF ApplEntry
    ACCESS      not-accessible
    STATUS      mandatory
    DESCRIPTION
        "A table with all currently running applications
        for each node."
    ::= { appls 1 }

applEntry OBJECT-TYPE
    SYNTAX      ApplEntry
    ACCESS      not-accessible
    STATUS      mandatory
    DESCRIPTION
        "A conceptual row in the applTable."
    INDEX   { erlNodeId, applId }
    ::= { applTable 1 }

ApplEntry ::= SEQUENCE {
    applId      INTEGER,
    applName    DisplayString,
    applDescr   DisplayString,
    applVsn     DisplayString
}

applId OBJECT-TYPE
    SYNTAX      INTEGER
    ACCESS      not-accessible
    STATUS      mandatory
    DESCRIPTION
        "An integer that uniquely identifies the application."
    ::= { applEntry 1 }

applName OBJECT-TYPE
    SYNTAX      DisplayString
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "The name of the application."
    ::= { applEntry 2 }

applDescr OBJECT-TYPE
    SYNTAX      DisplayString
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "A short description of the application."
    ::= { applEntry 3 }

applVsn OBJECT-TYPE
    SYNTAX      DisplayString
    ACCESS      read-only
    STATUS      mandatory
    DESCRIPTION
        "The version of the application."
    ::= { applEntry 4 }


-- conformance information

otpMIBCompliances
                OBJECT IDENTIFIER ::= { otpMIBConformance 1 }
otpMIBGroups    OBJECT IDENTIFIER ::= { otpMIBConformance 2 }


-- compliance statements

-- otpBasicCompliance MODULE-COMPLIANCE
--     STATUS      mandatory
--     DESCRIPTION
--         "The compliance statement for SNMPv2 entities which
--         implement the OTP-MIB."
--     MODULE  -- -- this module
--         MANDATORY-GROUPS { erlGroup, applGroup }
-- 
--     ::= { otpMIBCompliances 1 }


-- units of conformance

-- erlGroup OBJECT-GROUP
--     VARIABLES { erlNodeName,
--               erlNodeMachine,
--               erlNodeVersion,
--               erlNodeRunQueue,
--               erlNodeRunTime,
--               erlNodeWallClock,
--               erlNodeReductions,
--               erlNodeProcesses,
--               erlNodeInBytes,
--               erlNodeOutBytes }
--     STATUS  mandatory
--     DESCRIPTION
--         "A collection of objects providing basic instrumentation
--         of the Erlang runtime system."
--     ::= { otpMIBGroups 1 }

-- applGroup OBJECT-GROUP
--     VARIABLES { applName,
--               applDescr,
--               applVsn }
--     STATUS  mandatory
--     DESCRIPTION
--         "A collection of objects providing basic instrumentation
--         of the applications in the OTP system."
--     ::= { otpMIBGroups 2 }


END
