Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

snmp-walk.js 602B

123456789101112131415161718192021222324252627
  1. // Copyright 2013 Stephen Vickers
  2. var snmp = require ("../");
  3. var options = require("./option-parser");
  4. var session = options.session;
  5. var oid = options.oids[0];
  6. var maxRepetitions = options.maxRepetitions || 20;
  7. function doneCb (error) {
  8. if (error) {
  9. console.error (error.toString ());
  10. }
  11. }
  12. function feedCb (varbinds) {
  13. for (var i = 0; i < varbinds.length; i++) {
  14. if (snmp.isVarbindError (varbinds[i])) {
  15. console.error (snmp.varbindError (varbinds[i]));
  16. } else {
  17. console.log (varbinds[i].oid + "|" + varbinds[i].value);
  18. }
  19. }
  20. }
  21. session.walk (oid, maxRepetitions, feedCb, doneCb);