0

Is it possible to use a custom OID in the library #SNMP (http://sharpsnmplib.codeplex.com/)? If so, how can a custom OID variable/subtree be added/registered with #SNMP so it is possible to read and write to those variables?

I would like to extend/configure the agent deamon (snmpd) so it can read custom OIDs like iso.org.dod.internet.private.enterprise.XXX (1.3.6.1.4.1.XXX)

For testing purposes let's say a "fake" OID will be used (something like 1.3.6.1.4.1.99999.0).

What would be necessary to do in the #SNMP snmpd example agent so the program can read the values (snmpget, snmpgetnext...) of that OID?

According to the #SNMP Documentation (Documentation->Agent Development) when a handler tries to do a typical SNMP operation, it looks into the ObjectStore object to locate the specified object.

So in order to use a custom OID does it need to be added to the ObjectStore?

Is this the example of how to add an OID https://sharpsnmplib.codeplex.com/SourceControl/latest#SharpSnmpLib/Objects?

ips
  • 71
  • 2
  • 7
  • 1
    Please clarify. Are you implementing an SNMP Agent? If so, please read the relevant part of the documentation (http://sharpsnmplib.codeplex.com/wikipage?title=Agent%20Development&referringTitle=Documentation). After studying, please describe in your question what problem you are facing. – Jolta Oct 22 '14 at 12:10
  • I edited the post with more info – ips Oct 25 '14 at 22:44
  • Where would you put the object, if not in the Object Store? Try the example and post the results... – Jolta Nov 10 '14 at 12:52

1 Answers1

1

If you see into snmpd sample, you can see the ObjectStore is initialized in Program.Main for simplicity,

https://github.com/lextm/sharpsnmplib/blob/master/snmpd/Program.cs

If you follow the convention to insert your custom objects, you get what you want.

Lex Li
  • 60,503
  • 9
  • 116
  • 147