How to use the net-snmp.Version2c 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 node-red / node-red-nodes / io / snmp / snmp.js View on Github external
function SnmpWalkerNode(n) {
        RED.nodes.createNode(this, n);
        this.community = n.community;
        this.host = n.host;
        this.version = (n.version === "2c") ? snmp.Version2c : snmp.Version1;
        this.oids = n.oids.replace(/\s/g, "");
        this.timeout = Number(n.timeout || 5) * 1000;
        var node = this;
        var maxRepetitions = 20;
        var response = [];

        function feedCb(varbinds) {
            for (var i = 0; i < varbinds.length; i++) {
                if (snmp.isVarbindError(varbinds[i])) {
                    node.error(snmp.varbindError(varbinds[i]), msg);
                }
                else {
                    //console.log(varbinds[i].oid + "|" + varbinds[i].value);
                    response.push({ oid: varbinds[i].oid, value: varbinds[i].value });
                }
            }

net-snmp

JavaScript implementation of the Simple Network Management Protocol (SNMP)

MIT
Latest version published 30 days ago

Package Health Score

73 / 100
Full package analysis