I have developed a special application for a company under .net in C# and it is used for years. Now it is developed on, one of the main new features I have to implement is to integrate it with another software by sending SNMP traps to it in some alert situations.
Use different operations in the MIB Browser to perform SNMP get, get next and get bulk. If you have provided a valid OID correctly, the MIB Browser will fetch the current value of this OID using an SNMP Get. A MIB Tree can be walked using ‘Get Next’, ‘Get Bulk’, ‘Get Subtree’ and other options provided in the dropdown box.
I am an experienced developer but I have never used SNMP. I googled the whole day but getting more and more confused about this topic. I don't have a clear 'starting point'. I understand the basics of SNMP but I don't know where and how to begin implementation.
I have the data I should send via SNMP trap, it has some 10 properties, some dates, numbers and strings. I should create MIB definition(s) on this properties. Later I should implement a feature in my application that sends SNMP traps based on this MIBs.
The project is developed under .net 4 in c#. I found this library that seems promising: http://sharpsnmplib.codeplex.com/It has some sample about sending SNMP traps.
My problem is: where to begin? How can I define MIB files? I know they're some text files that must be compiled, but have not find any MIB editors and help on this topic.
Any help is appreciated!
Thanks!
TomTom
6 Answers
I am not an expert, but have experience of being in the same spot as you were and finally found something enough for my project.
I used this codeplex library you referred before and found to be quite good. Here are some pointers for you to go through the http://sharpsnmplib.codeplex.com/.
As far as my understanding goes an MIB file is required when you need to do a snmpget and snmpset
This is sort of you informing the server and the server coming back to your client asking for more detailed info, and may be required if you require extensive info to be shared about your app
If all you need is just traps, you can do this
Run the snmpd.exe which will act like the snmp server receiving traps sent from your application.
Write a program similar the snmptrapd.exe and send your traps.
The link http://www.net-snmp.org/wiki/index.php/TUT:snmptrap is a good one for getting a basic understanding and get more library info.
Edit: Just missed one point. You'll need MIB file if you use get and set for snmp. If all you have is traps, you may not need it.
MuthuMuthu
In SNMP V2 MIBs, traps are described as NOTIFICATION. See a full example of such a MIB here:http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&mibName=CISCO-EPM-NOTIFICATION-MIB
C. RamseyerC. Ramseyer
Since apparently you're using Windows OS to work with SNMP then you need to create custom SNMP extension agent in order to add custom SNMP OIDs and corresponding traps in to your system. Each OID will literally present a variable where you can store your information. Here is an example of such DLL. As far as I know MIB files are only used in Windows as reference for SNMP agents and can't be used to add new OIDs without creating custom SNMP agent.
When you'll have your custom SNMP agent DLL, you need to point it in registry. Can be done like that (example):
After that you'll need to restart your SNMP service. If everything is right you'll be able to use your new custom OID to setget some data.
In order to readwrite in to your SNMP variables you'll need to use SNMP manager. I'm usually using Sharpsnmplib to do so. There are also GUI managers that will be usefull during debug process, for example: iReasoning MIB Browser.
Here is sample code to use that lib:
Also you can read article about working with SNMP in Windows OS on technet: link. This Article is not new but might help you to understand how to wok with SNMP in Windows.
TelanarTelanar
If you just need to send traps, you do not have to define MIBs. MIBs are for other parties to understand the meaning of variables in it. You can document it using other format such as a text file.
For sending traps, you can make use of a C# SNMP library, or just invoke snmptrap program directly. Net-snmp provides free command line tools for sending traps. ( http://net-snmp.sf.net ). Its usage is pretty simple.
To verify if the traps have been sent out successfully, you can use the free ireasoning MIB browser ( http://ireasoning.com/mibbrowser.shtml ) to receive them. If it can be received, it usually means your traps are fine.
user814168user814168
So from http://www.net-snmp.org/tutorial/tutorial-5/commands/snmptrap.html
The SNMPv2 notification
The format of the SNMPv2 notification is somewhat different. The definition in the MIB file looks as follows
user1821543user1821543
You also can try with snmpsharpnet which is very helpful to play with SNMP on the top of .NET ?
As MIB editor I use MG-SOFT MIB Browser, the profesional edition is sold with Visual MIB Builder for Windows.
JPBlancJPBlanc
Not the answer you're looking for? Browse other questions tagged .netsnmpmibsharp-snmpsnmp-trap or ask your own question.
67
ManageEngine SNMP MIB Browser for Android enables the user to monitor and manage the MIB data for any SNMP enabled network devices like desktops, routers, switches, etc., on the move. This app enables the user to load any standard MIB and fetch values from the devices. It fetches data for scalar/tabular groups and displays it in an intuitive user interface. It also supports SNMP SET operation, using which the user can modify the data on a device. MibBrowser supports SNMPv1, SNMPv2c and SNMPv3 versions. If User opts SNMPv3 version for communication, he has the option to select HMAC algorithms like MD5, SHA for authentication and DES, 3DES, AES-128, AES-192 and AES-256 for encryption. Tool has an option to poll the SNMP enabled devices at a periodic interval, which is configurable. Key Features : * Load any MIB from any location on the device and fetch MIB data. * Fetch MIB data in ALL versions of SNMP(v1, v2c, v3) from agents implemented by any vendors. * Support for SNMP SET Operation. * User can configure agent parameters * Perform SNMP Polling for particular ObjectID on the device. * Fetch MIB data of any scalar or tabular group, just by a click * Support for MD5 and SHA authentication algorithms and DES, 3DES, AES-128, AES-192, AES-256 encryption for SNMPv3 packets. * Tool remembers all device details like host, port, community string so that user need not enter these details every now and then. Prerequisite : To run this application, WiFi connectivity is required to communicate with the local Network/Internet. Copy the required MIBs in the mibs directory, which would have been created during installation in the root path of the Memory card. The MIB files should have .mib, .my, or .txt extensions, if any, and are not case sensitive. While loading MIB files from a location other than the mibs directory created, load the dependent MIBs (if any) before loading the required MIB.
Collapse
67 total
4
2
November 16, 2018
4.1M
10,000+
1.6
4.0 and up
Google Commerce Ltd
Zoho Corporation4141 Hacienda DrivePleasanton, CA 94588, USA