calmh/node-snmp-native — pull request #15 by fmgdias (2014-03-13 21:48:10+00:00)
Title: Added Support to GetBulkRequestPDU

Example for Testing:

```nodejs
#!/usr/bin/nodejs

var snmp = require('snmp-native');
var util = require('util');

// host
var host = '127.0.0.1';
var community = 'public';

// oids
var _sysDescr = [1, 3, 6, 1, 2, 1, 1, 1, 0];
var _ifName = [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1];
var _ifSpeed = [1, 3, 6, 1, 2, 1, 2, 2, 1, 5];

// session
var snmpSession1 = new snmp.Session({
host: host,
community: community
});
snmpSession1.get({
oid: _sysDescr
}, function(err, varBinds) {
console.log(" #1, err: " + util.inspect(err, false, null));
console.log(" #1, varBinds: " + util.inspect(varBinds, false, null));
snmpSession1.close();
});
/**/

// session, make one request for each oid in the tree, check the requestId, is diferent
var snmpSession2 = new snmp.Session({
host: host,
community: community
});
snmpSession2.getSubtree({
oid: _ifName
}, function(err, varBinds) {
console.log(" #2, err: " + util.inspect(err, false, null));
console.log(" #2, varBinds: " + util.inspect(varBinds, false, null));
snmpSession2.close();
});
/**/

// session, make just one request for all oids in tree, check the requestId, is the same
var snmpSession3 = new snmp.Session({
host: host,
community: community
});
snmpSession3.getSubtreeBulk({
oid: _ifSpeed
}, function(err, varBinds) {
console.log(" #3, err: " + util.inspect(err, false, null));
console.log(" #3, varBinds: " + util.inspect(varBinds, false, null));
snmpSession3.close();
});
/**/
```