[erlang-patches] Fwd: [erlang-questions] SNMP AGENT-CAPABILITIES

Niclas Axelsson burbas@REDACTED
Thu Dec 2 17:34:29 CET 2010


On 12/01/2010 09:33 PM, Dmitriy Kargapolov wrote:
> Patch proposed allowing to compile and use (in limited way - see below)
> AGENT-CAPABILITIES macro in the MIBs.
>
> git fetch git://github.com/xoid/otp.git agent_capabilities
>
> Thanks.
>
> ---------- Forwarded message ----------
> From: Dmitriy Kargapolov<dmitriy.kargapolov@REDACTED>
> Date: Wed, Dec 1, 2010 at 3:21 PM
> Subject: Re: [erlang-questions] SNMP AGENT-CAPABILITIES
> To: Martin Bjorklund<mbj@REDACTED>
> Cc: erlang-questions@REDACTED
>
>
> Hi Martin,
>
> On Wed, Dec 1, 2010 at 7:09 AM, Martin Bjorklund<mbj@REDACTED>  wrote:
>
>    
>> Hi,
>>
>> Dmitriy Kargapolov<dmitriy.kargapolov@REDACTED>  wrote:
>>      
>>> Trying to improve SNMP agent for some app written in Erlang, I found that
>>> Erlang MIB compiler does not support AGENT-CAPABILITIES statement which
>>>        
>> is
>>      
>>> actually a macro from SNMPv2-CONF.
>>>        
>> Normally, an invocation of the AGENT-CAPABILITIES macro is specified
>> in a separate document from the normal MIB modules.  It documents how
>> a certain agent (or family of agents) conforms to a set of MIB
>> modules.
>>
>>      
> Compiler is indifferent to the layout and AGENT-CAPABILITIES location. It
> just did not recognize this construct.
>
>
>    
>> Do you mean that you want the MIB compiler to support this use case?
>> If so, what exactly do you want the compiler to do?
>>
>>      
> In some (odd) cases you get files with both normal MIB modules, and an
>    
>> AGENT-CAPABILITIES invocation in the same file.  Is this the use case
>> you want to support?
>>
>>      
> > From SNMP agent perspective, it is enough to register OID of the
> AGENT-CAPABILITIES object, so I would later to use smpa:name_to_oid/1 to
> resolve its name and snmpa/add_agent_caps/2 to add this OID to sysORTable...
> This is exactly what I implemented in my minimalistic patch.
>
> > From SNMP manager perspective it would be nice to have access to the whole
> content of the AGENT-CAPABILITIES construct. To make possible to decide
> which part of features of agent have to be supported in manager at runtime.
> I understand that this task requires a bit more time (which I do not have),
> so its ok to leave this for future, if needed.
>
>
>    
>> I have modified the MIB compiler to "support" this macro.  The grammar
>> builds a record of the information, and then the compiler ignores this
>> record.  Some day I should make it available in git...
>>
>>
>> /martin
>>
>>      
> I have published my changes to the branch agent_capabilities at git://
> github.com/xoid/otp.git.
>
>    
Hi Dmitriy,

Your patch does not compile on my machine. Here is my output from the 
compilation:

erlc -W  -o . -o. snmpc_mib_gram.yrl
erlc -W  +debug_info -I../../include -Dversion=\"4.18\" 
+'{parse_transform,sys_pre_attributes}' 
+'{attribute,insert,app_vsn,"snmp-4.18"}' -I/otp/lib/stdlib -o../../ebin 
snmpc_mib_gram.erl
erlc -W  +debug_info -I../../include -Dversion=\"4.18\" 
+'{parse_transform,sys_pre_attributes}' 
+'{attribute,insert,app_vsn,"snmp-4.18"}' -I/otp/lib/stdlib -o../../ebin 
snmpc.erl
./snmpc.erl:1022: function l/2 undefined
make[3]: *** [../../ebin/snmpc.beam] Error 1

Please check the error and when you have a solution, let me know.
As it is now I can not include this patch into 'pu'.

/Niclas Axelsson, Erlang/OTP


More information about the erlang-patches mailing list