Appcelerator Titanium SNMP module is now open sourced
We recently open sourced the nf_snmp Titanium module, and have released the code on Github.
Quick example of how to use this
var snmpModule = require("netfunctional.snmp");
var snmp = snmpModule.createSNMPClient({
hostname : hostaddress,
community : "public",
mib : 'system.sysUpTime.0',
time_out : 50000 // 5 seconds
});
snmp.open();
var result = snmp.fetch();
snmp.close();
if(result == null) {
//_callback(null);
return null;
} else {
var temp = result.split(" ");
var tmp2 = '';
for(var i = 3; i < temp.length; i++) {
tmp2 += temp[i] + " ";
}
return _callback(hostaddress, tmp2);
}