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

Andy Li J <>
Tue Dec 30 02:32:27 CET 2014


Hi Dominik,

Thanks very much.
I try to construct the pdu according to the my conjecture (they may has the element max_repetitions and non_repeaters),
but I found that it was wrong…
Get bulk has reused the error_status and error_index.

B.R
Andy


From: Dominik Pawlak [mailto:]
Sent: Wednesday, December 24, 2014 8:48 PM
To: Andy Li J; 
Subject: Re: [erlang-questions] How to define snmp get bulk request pdu including max-repetitions and no-repeaters

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

<mailto:>

http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141230/3f7e8682/attachment.html>


More information about the erlang-questions mailing list