Node-Red configuration
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

snmp-subtree.js 590B

12345678910111213141516171819202122232425
  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. function feedCb (varbinds) {
  12. for (var i = 0; i < varbinds.length; i++) {
  13. if (snmp.isVarbindError (varbinds[i]))
  14. console.error (snmp.varbindError (varbinds[i]));
  15. else
  16. console.log (varbinds[i].oid + "|" + varbinds[i].value);
  17. }
  18. }
  19. session.subtree (oid, maxRepetitions, feedCb, doneCb);