node package manager


Simple Network Management Protocol toolkit

snmpjs provides a toolkit for SNMP agents and management applications in Node.js.

For full docs, see

var os = require('os');
var snmp = require('snmpjs');

var agent = snmp.createAgent();

agent.request({ oid: '.', handler: function (prq) {
	var nodename = os.hostname();
	var val ={ type: 'OctetString',
	    value: nodename });

	snmp.provider.readOnlyScalar(prq, val);
} });

agent.bind({ family: 'udp4', port: 161 });

Try hitting that with your favourite SNMP get utility, such as:

$ snmpget -v 2c -c any localhost .
$ npm install snmpjs