Node-snmp is a project mainly written in C++ and JAVASCRIPT, based on the View license.
Binding for Net-SNMP library, and simple wrapper to make life a bit easier.
So far only snmp queries and protocol V1 are supported. It has both synchronous and asynchronous interface, but the former requires libev compiled with support for multiple event loops. As stock node is by default compiled without this, only asynchronous queries are usually available - unless you compile node binary yourself.
Net-SNMP library - tested with version 5.4.3
See http://nodejs.org/docs/v0.4.7/api/modules.html for details.
Eventually, "npm install -g" should do the trick too, but I can't seem to get it to work right now.
$ # git clone <url>
$ git branch debian origin/debian
$ git-buildpackage --git-upstream-branch=master --git-debian-branch=debian --git-force-create -us -uc
At present, you need nodejs-dev package from debian/sid repository to build. git-buildpackage is optional, debian has several options, but I found this to be the easiest way.
all callbacks are called with fairly standard (error, data) arguments.
Error can be used as boolean false when query finished successfully, Error object with error description otherwise (convertible to String).
Data is array of objects with 'value' and 'oid' properties, both of them of type Value:
[
{ oid: ..., value: ... },
{ oid: ..., value: ... }
]
var conn = new (require('snmp').cSnmpConnection)("localhost", "public");
conn.get(".1.3.6.1.2.1.1.1", function(aError, aData) {
console.log(aData[0].value.toString());
});
see examples/ directory for more complete sample
(in no particular order)