markabrahams / node-net-snmp

JavaScript implementation of the Simple Network Management Protocol (SNMP)
206 stars 97 forks source link

Update MIB tree from existing MIB file #234

Closed eladGishri closed 1 year ago

eladGishri commented 1 year ago

I'm implementing an SNMP agent. I using my company's existing MIB file.

I got and registered the providers but as stated in the documentation it doesn't update the MIB tree. Is there a way to update the entire MIB tree of an enterprise size MIB file?

This is my current code:

let store = snmp?.createModuleStore();
store.loadFromFile(mibPath);
let jsonModule = store?.getModule(<ModuleName>);

// Fetch MIB providers, create an agent, and register the providers with your agent
const providers = store.getProvidersForModule(<ModuleName>);
let mib = agent.getMib();
mib.registerProviders(providers);
markabrahams commented 1 year ago

Hi @eladGishri - yes, you can find the calls you need to populate your MIB in the README documentation: