Since you are apparently using Windows for SNMP, you need to create your own SNMP extension agent to add custom SNMP identifiers and associated traps to your system. Each OID literally represents a variable in which you can store your information. Here is an example of such a DLL . As far as I know, MIB files are used only in Windows as a reference for SNMP agents and cannot be used to add new OIDs without creating a custom SNMP agent.
When you have your custom SNMP agent DLL agent, you need to specify it in the registry. You can do this (example):
[HKEY_LOCAL_MACHINE\SOFTWARE\Symbol\MyAgent\CurrentVersion] "Pathname"="C:\\MyCustomAgent\\MyAgent.dll" ;Add number of agent to the list (max num registered + 1) [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents] "10"="SOFTWARE\\Symbol\\MyAgent\\CurrentVersion"
After that, you will need to restart the SNMP service. If everything is correct, you can use your new custom OID to set \ receive some data.
To read / write to your SNMP variables, you will need to use the SNMP manager. I usually use Sharpsnmplib . There are also graphical managers that will be useful during the debugging process, for example: iReasoning MIB Browser .
Here is sample code for using lib:
using System.Collections.Generic; using System.Net; using System.Net.Sockets; // SNMP Lib references using Lextm.SharpSnmpLib; using Mono.Options; using Lextm.SharpSnmpLib.Messaging; using Lextm.SharpSnmpLib.Security; ... List vList = new List(); ISnmpData data; data = new OctetString("test"); // variable to add in to string OID Variable test = new Variable(new ObjectIdentifier("1.3.6.1.2.1.1.6.0"), data); // OID vList.Add(test); VersionCode versionH = VersionCode.V2; // SNMP protocol version to use IPAddress ipH; IPAddress.TryParse("127.0.0.1", out ipH); IPEndPoint receiverH = new IPEndPoint(ipH, 161); foreach (Variable variable in Messenger.Set(versionH, receiverH, new OctetString("private"), vList, 10))// set variable // Arguments: (ver of SNMP, IP, group, iList containing OID and variable, timeoout) { // output variable } ...
You can also read an article about working with SNMP in Windows on technet: link . This article is not new, but may help you understand how to work with SNMP on Windows.