Resources to build SNMP support for my device? - snmp

Can any one recommend resources for adding SNMP support for my device? my understanding the steps I need to do are as follow:
Create a MIB file that define what values your MIB will support
Use code generator to convert it to C module
Use generated code to fetch real values
Convert the module to an agentx sub agent, so you can integrate your MIB a separate process that could work with any snmp agent that support agentx protocol.
Are my assumption correct, any suggestions or corrections, I am specially looking for resources that help me, books, courses, online, etc...
Thanks

Your questions would be answered differently depending on which toolkit you go with. However, if you run with the common Net-SNMP one (free as in beer) then you should probably start with the tutorials on that site that walks you through much of what you're asking.
http://www.net-snmp.org/wiki/index.php/Tutorials
However, it doesn't discuss how to write a MIB. For that the best book on the subject is "Understanding SNMP MIBs".

Related

Can we see the kernel source code for Windows 7?

I study on entropy source using the Random number generator.
So I want to see a kernel source code.
However, I don't exactly know this, and i know this is not known.
Would you tell me about this?
Thanks.
Windows Driver Foundation forbids such actions due to obvious malicious stuff that can happen if the source code leaks
If you have access to enough information about the device you're using, you could try writing a skeleton driver. However, some TRNGs have open-source driver code, so if yours is one of them, you could download that. If those aren't options in your case, unfortunately proprietary software companies do not generally share their source code (though Microsoft does share their code with certain CS departments in academia - if you're affiliated with one, you could look into that).

I'm using SCADA-LTS and I want test MBus datasource

Is there any emulator available for MBus TCP/IP protocol.
Is somebody using this protocol in SCADA-BR or SCADA-LTS?
Please give me any suggestion how can I test this data source.
As far as I understand your question you are seeking for an alternative to buying hardware M-Bus converter. Unfortunately for what I know there is no free software M-Bus emulator available. If you serious about M-Bus you may consider getting into contact with one of many firms offering services for M-Bus customers. However if you prefer Do-It-Yourself approach and are going to write such emulator yourself take a look at libmbus library (open source C library) using of which may greatly simplify such task.

Library/API for development of SNMP manager

I'm new to SNMP. I have to develop a manager. I've been searching on how to program for a manager. I've come across WinSNMP, SNMP++ and Net-SNMP. The plus point for Net-SNMP is that it can translate the trap content from the MIB (it can parse the MIB). But would Net-SNMP be a good choice of library for developing a manager? I was wondering if it would be a good idea to use snmptrapd as a basis to develop a manager. At the moment I'm focusing on receiving traps but eventually I'll have to program for the others too (Get, Set, ...).
What is the general outline on how to program for a manager? I have been reading on SNMP for weeks but still haven't got a clear understanding of how to go about doing it.
Any help would be much appreciated. Thanks.
Which toolkit you want will greatly depend on your final-end-goals and preferred language (eg, C vs C++). Make sure you get one with SNMPv3 support, which the native windows library doesn't have (but mg-soft and snmp research's implementation does). You'll likely have to pay money, eventually, if you want SNMPv3 support on windows using the winsnmp APIs.
Net-SNMP and SNMP++ are both well respected open libraries. Net-SNMP has pretty much cornered the market in terms of deployment and comes pre-installed or easily available on every OS except windows (where it also works fine, but MS just doesn't package it for you).
If you want to receive traps, Net-SNMP's snmptrapd is certainly an easy place to start and offers some very simply ways to get started through extensible commands (see the snmptrapd.conf man page to help you get started) or via C (see the apps/snmptrapd*.c files for some example C-registrations).
To get started with Net-SNMP and programming outgoing management operations, you should start with the tutorials about writing management applications. If your management application is ever going to talk to multiple hosts at once, make sure you get a toolkit that does asynchronous support (see the second item in the above link).
There is also JDMK 5.1 API from Sun microsyatem, it is very easy to develop the SNMP Agent as well Manager.

SNMP MIB design

I'm faced with the need to write a new MIB description. Does anyone know of a good tutorial or reference? I seem to find lots of stuff about using SNMP and Net-SNMP has decent stuff about implementing an agent, but it seems like the only real sources on writing the MIBs are RFCs.
Mg Soft company is selling a very good tool called "Mib Browser" but they also edit a product called "Visual MIB Builder", which provide an easy way to build MIBs without dealling with ASN1 syntax.
Mibs are built on ASN1 syntax, you definitively not need to understand all ASN1 language. I wrote a few PPT slides to explain that, but they are in french.
Edited (1)
I built MIBs twelve years ago, and I learnt by myself with a couple of books (Practical Guide to Snmpv3 and Network Management, Essential SNMP).
On the semantic point of view the first three advices that come in my mind are :
Learn how tables are built and how they works (get-next usage and index)
Have a look to Textual Conventions, they mostly appears in SNMPv2 giving names to implicit usages in SNMPv1. For example you'll read how TestAndIncr provides the mutex semantic. They are improved in SNMPv3. But understand that you have to provide the code for doing that in your agent, they are just TCs.
I learnt a lot in understanding how RMON1 MIB was working, and especialy the usage of configuration tables.
Just an advice, SNMP is a nice protocol, it's a bit old, and except with SNMPV3 it still lives in a boudhist world. I just mean that V1 and V2 are just ignoring the security point of view. So be careful with writable leafs, you can deploy an active agent protecting SNMP ports with IPSec but it's 'expensive'.
Do you have a look to Web-Based Enterprise Management (WBEM) ? On Windows I play with WMI which is Microsoft adaptation of this standard, but on Linux you can play with OpenPegasus.

Writing an SNMP Agent for Windows: SnmpAPI.Lib or MgmtAPI.lib?

I need to write an SNMP agent on Windows for our company product.
SnmpApi.lib - It's my understanding that SnmpApi.lib allows you to create a full agent from scratch and probably requires more work. This, however, takes over the SNMP port and doesn't allow other agents to run and will take longer to code.
MgmtAPI.lib - This lib will allow one to create an extension to the already running Windows SNMP service and seems a more elegant approach to creating an Windows agent. However, I'm findining very little official MS documentation/examples on how to code such an agent. I've also read on another forum that this might be deprecated.
I've seen an Oreilly book out in the wild called "Windows NT SNMP" but I heard it uses deprecated libs or techniques. I don't know if this is true or not.
I've also seen libraries like SNMP++ that use the SnmpAPI.lib to create an agent, but again, this isn't as elegant as letting multiple sub-agents on the system via MgmtAPI.lib, it seems.
A few questions:
I heard that MgmtAPI.lib is legacy/deprecated. Is this true?
What's the best practice for creating a Windows SNMP agent?
What library should i be using?
Any other suggestions?
Thank you!
The default windows SNMP stack and framework is very limited in its ability. Unfortunately, your best solutions are probably found elsewhere (of which there are a number of external libraries and stacks). If you want one that is modular and allows sub-agents, then look into a stack that supports the AgentX protocol. That's a standardized SNMP subagent protocol and will let multiple sub-agents attach to a master agent.
But whatever you do, please pick a stack that supports SNMPv3 and use the security in it.
If you want a random stack example that is known to work well on windows, try Net-SNMP which is fairly popular among the "replace the SNMP stack on windows" crowd. But I'm also biased and associated with the project, so I'll end with saying: "it doesn't matter too much; pick any stack that supports both AgentX and SNMPv3".

Resources