SNMP toolkit for Node.js
JavaScript Makefile
Permalink
Failed to load latest commit information.
deps joyent/node-snmpjs#225 update dependencies for modern systems Mar 23, 2015
docs migrate repo to joyent Aug 7, 2013
lib joyent/node-snmpjs#38 Add Client class Mar 23, 2015
smf/manifests Initial code drop Feb 29, 2012
test/protocol joyent/node-snmpjs#23 enable programmatic consumption of Counter64 va… Jul 23, 2014
tools Initial code drop Feb 29, 2012
.gitignore Fix README example code Mar 2, 2012
.gitmodules Initial code drop Feb 29, 2012
Makefile joyent/node-snmpjs#38 Add Client class Mar 23, 2015
Makefile.deps joyent/node-snmpjs#225 update dependencies for modern systems Mar 23, 2015
Makefile.targ joyent/node-snmpjs#225 update dependencies for modern systems Mar 23, 2015
README.md joyent/node-snmpjs#19 example does not work out of the box Feb 13, 2014
agent.js Clean up MIB/Agent/Provider interfaces Mar 13, 2012
agent.json Fix README example code Mar 2, 2012
package.json joyent/node-snmpjs#225 update dependencies for modern systems Mar 23, 2015
snmpbulkget.js joyent/node-snmpjs#38 Add Client class Mar 23, 2015
snmpget.js joyent/node-snmpjs#38 Add Client class Mar 23, 2015
snmpinform.js joyent/node-snmpjs#38 Add Client class Mar 23, 2015
snmpset.js joyent/node-snmpjs#38 Add Client class Mar 23, 2015
snmptrap.js joyent/node-snmpjs#38 Add Client class Mar 23, 2015
snmpwalk.js joyent/node-snmpjs#38 Add Client class Mar 23, 2015
tl.js joyent/node-snmpjs#38 Add Client class Mar 23, 2015
tl.json joyent/node-snmpjs#6 Question on how to listen for traps Jan 31, 2013

README.md

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

Usage

For full docs, see http://joyent.github.com/node-snmpjs/.

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

var agent = snmp.createAgent();

agent.request({ oid: '.1.3.6.1.2.1.1.5', handler: function (prq) {
	var nodename = os.hostname();
	var val = snmp.data.createData({ 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 .1.3.6.1.2.1.1.5.0

Installation

$ npm install snmpjs

License

MIT.

Bugs

See https://github.com/joyent/node-snmpjs/issues.