SNMP MIB Data type - equivalent to Erlang "atom" ?

Serge Aleynikov <>
Thu Jun 23 16:47:30 CEST 2005


Though it is beyond the scope of this mailing list, here is a sample MIB 
definition containing an integer enum:

balanceMethod OBJECT-TYPE
         SYNTAX INTEGER
                 {
                 random(0),
                 roundRobin(1),
                 leastTime(2)
                 }
         MAX-ACCESS read-write
         STATUS current
         DESCRIPTION
                 "Back-end server balancing method"
         ::= { drpProxyObjects 17 }

Serge

Sanjaya Vitharana wrote:

> Dear Sege/Martin,
> 
> What both of you are telling I can understand.(about some data type of
> "integer enum" or "predefined enumerated set" in the MIB)
> 
> But applying that "integer enum" type in the MIB is a bit problem for me.
> 
> Hence I'm going back to my previous question with the term of "integer
> enum".
> ----------------------------------------------------
> So.....How Should I apply "integer enum" in MIB
> 
>           myAtom OBJECT-TYPE
>               SYNTAX  *********What is the Equelant to put here********
> %%Or in other words how to write "integer enum" data type in MIB.
>               ACCESS  read-write
>               STATUS  mandatory
>               DESCRIPTION
>                       ""
>               ::= { myObjects 1 }
> ----------------------------------------------------
> Regards,
> 
> Sanjaya Vitharana
> 
> 
> 
> ----- Original Message -----
> From: "Serge Aleynikov" <>
> To: "Martin Bjorklund" <>
> Cc: <>; <>
> Sent: Thursday, June 23, 2005 3:41 AM
> Subject: Re: SNMP MIB Data type - equivalent to Erlang "atom" ?
> 
> 
> 
>>True.  Though, in that case anyatom can't really be any atom, but a
>>predefined enumerated set.
>>
>>Martin Bjorklund wrote:
>>
>>
>>>Serge Aleynikov <> wrote:
>>>
>>>
>>>>You need to use DisplayString type in your MIB, and use
>>>>{value, atom_to_list(anyatom)} in your instrumentation function.
>>>
>>>
>>>Or use an integer enum in the MIB.  The agent will convert the atom to
>>>the appropriate integer.
>>>
>>>
>>>/martin
>>>
>>>
>>>
>>>
>>>
>>>>Also, to answer your former question on accessing the agent from other
>>>>hosts - remove {intAgentIpAddress, [127,0,0,1]} entry from agent.config
>>>>file, or change that IP to the public one assigned to the interface.
>>>>
>>>>Serge
>>>>
>>>>Sanjaya Vitharana wrote:
>>>>
>>>>
>>>>>Hi....!!!,
>>>>>
>>>>>!!!!!....Can any body help me to sort this out.....!!!!
>>>>>
>>>>>What is the MIB Data type equivalent to "atom" ?
>>>>>
>>>>>For Example:
>>>>>
>>>>>assume that I have a function:
>>>>>----------------------------------------------------
>>>>>getAtom(get) ->
>>>>> {value, anyatom}. %% note that returning value is an atom of
> 
> "anyatom"
> 
>>>>>----------------------------------------------------
>>>>>How Should I map it in MIB (What is the Type ?)
>>>>>
>>>>>         myAtom OBJECT-TYPE
>>>>>             SYNTAX  ***What is the equivalent data type to put
>>>>>here***    %%I know How to handle INTEGER/DisplayString  (FROM
>>>>>RFC1213-MIB). But atom ???
>>>>>             ACCESS  read-write
>>>>>             STATUS  mandatory
>>>>>             DESCRIPTION
>>>>>                     ""
>>>>>             ::= { myObjects 1 }
>>>>>----------------------------------------------------
>>>>>Regards,
>>>>>
>>>>>Sanjaya
>>>
>>>
>>--
>>Serge Aleynikov
>>R&D Telecom, IDT Corp.
>>Tel: (973) 438-3436
>>Fax: (973) 438-1464
>>



More information about the erlang-questions mailing list