[erlang-questions] How to define snmp get bulk request pdu including max-repetitions and no-repeaters

Dominik Pawlak <>
Wed Dec 24 13:48:12 CET 2014


Hello Andy,
Don't know why you try to construct the pdu yourself, but I can see that 
in the snmp application the code for constructing bulk request pdu is:

make_pdu(bulk, {NonRepeaters, MaxRepetitions, Oids}, MiniMIB) ->
     Foids = [flatten_oid(Oid, MiniMIB) || Oid <- Oids],
     #pdu{type         = 'get-bulk-request',
      request_id   = request_id(),
*     error_status = NonRepeaters, **
**     error_index  = MaxRepetitions,*
      varbinds     = [make_vb(Foid) || Foid <- Foids]};

The standard way to perform a bulk request would be:

snmpm:sync_get_bulk("snmp_user", "snmp_agent", 0, 3, 
[[1,3,6,1,4,1,14817,3,12,2,10,1,5,1]]).

Best
Dominik

On 24.12.2014 09:56, Andy Li J wrote:
>
> Hi all,
>
> If I want to define a snmp get request pdu, and the format as follows:
>
> #pdu{ type = ‘get-request’, request_id = ReqId,
>
>              error_status = noError, error_index = 0,
>
>              varbinds }
>
> And if I want to define a snmp get  bulk pdu including max-repetitions 
> and no-repeaters, how to define it?
>
> I try the following, but report max_repetitions and no_repeaters 
> undefined in record pdu.
>
> #pdu{ type = ‘get-bulk-request’, request_id = ReqId,
>
>              max_repetitions = MaxRepetitions, non_repeaters = 
> NonRepeaters,
>
>              varbinds }
>
> But I find that in RFC3416,
>
> BulkPDU ::= -- must be identical in
>
>        SEQUENCE {                      -- structure to PDU
>
>            request-id      INTEGER (-214783648..214783647),
>
>            non-repeaters   INTEGER (0..max-bindings),
>
>            max-repetitions INTEGER (0..max-bindings),
>
> variable-bindings           -- values are ignored
>
>                VarBindList
>
>        }
>
> Could you help me? Thanks very much.
>
> B.R
>
> Andy
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141224/45c39e78/attachment.html>


More information about the erlang-questions mailing list