Question

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

above is my sample MIB file for scalar Object.. poolUsage is a storage for a single OID... I want to add it as a table with that I can assign values like poolUsage.1, poolUsage.2 etc etc.. I want to convert this scalar to a "table" format... What changes should I do ? Please help me.

Was it helpful?

Solution

I'd strongly suggest you get a book on MIBs if you need to write anything complex at all. It's an "interesting" language and it's better if you get it right when you write something...

But, you should at least read RFC2578 which describes the language (more formally than is a tutorial, however). You might also look at an example, such as RFC2863: the IF-MIB, which contains a simple table (ifTable) with a structure you can copy.

OTHER TIPS

See this tutorial. I think it is exactly what you need.

The essentials of it is reproduced below:

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 }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top