Objects of multisession class

Instances of multisession class have the following methods:

submit_request(agent[, community[, type[, encoded_oids[, encoded_vals]]]])

Create new SNMP request of specified type for SNMP Object IDs encoded_oids and their associated values encoded_vals (both given as lists) to SNMP process running on agent with specified SNMP community and add it to the list of pending requests.

The default value for type is `GETREQUEST'.

The default value for community is `public'.

The default values for encoded_oids and encoded_vals are empty lists.

Object IDs and their respective values are matched against each other by their positions in the encoded_oids and encoded_vals lists.

The payload for type, encoded_oids and encoded_vals lists can be build with methods, inherited from message superclass.

dispatch()

Attempt to send all pending SNMP requests previously submitted with submit_request() and receive SNMP responses or time out in timeout seconds.

retrieve()

Return SNMP responses previously collected by the dispatch() method as a list of BER encoded pairs of BER encoded SNMP Object IDs and their associated values. These BER encoded data can be parsed with methods, inherited from message superclass.

SNMP responses are returned in exactly the same order as SNMP requests were submitted to submit_request() method to facilitate response to request matching.

Unsuccessful requests are indicated by empty entries in the list of responses returned.

initialize()

Re-initialize private class instance variables to get ready for subsequent use.

This method is invoked automatically upon class instance creation and must be re-invoked before every instance reuse.

Objects of multisession class have the following public instance variables:

iface

Specify the IP number of local interface SNMP engine is to bind to. All SNMP requests would be originated from the interfaces SNMP engine binds to.

The value of the iface variable takes effect only if specified before submit_request() method is invoked.

The iface attribute should be a list of strings where each string should represent either FQDN or IP number of desired local interface.

The default value is None what means to bind to all the local interfaces and originate SNMP request from primary system interface.

XXX: current implementation binds ONLY to the first interface of the list.

timeout

Specify for how many seconds to wait for response from SNMP agent. The timeout attribute is of floating point type.

The default is 1.0 second.

retries

Specify the number of request re-transmissions. The retries attribute is of integer type.

The default is 3 retries.


ilya@glas.net