How to use the net-snmp.TrapType function in net-snmp

To help you get started, we’ve selected a few net-snmp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github glenmurphy / route / modules / snmp_dev / snmp.js View on Github external
this.session.get (oids, function (error, varbinds) {
    if (error) {
        console.error (error);
    } else {
      for (var i = 0; i < varbinds.length; i++) {
        if (snmp.isVarbindError(varbinds[i])) {
          console.error (snmp.varbindError (varbinds[i]));         
        } else {
          console.log (varbinds[i].oid + " = " + varbinds[i].value);          
        }
      }
    }
  });


  this.session.trap (snmp.TrapType.LinkDown, function (error) {
    if (error)
      console.error ("!  SNMP ", error);
  });
};
util.inherits(SNMP, EventEmitter);

net-snmp

JavaScript implementation of the Simple Network Management Protocol (SNMP)

MIT
Latest version published 19 days ago

Package Health Score

82 / 100
Full package analysis