Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello, I've done a bunch of googling and have not found an answer to this.

I need to write a SNMP agent in C++ (actually add it to an atl dcom server) that broadcasts status information via SNMP trap messages. Then I need to write a C# application to monitor these SNMP trap (status) messages that have been broadcasted.

Does anyone know how I can write a simple agent to broadcast trap messages in SNMP?
I have found some info on this but it seems very confusing.
and
Does anyone know how I can read / monitor these SNMP trap messages in a C# application? I can find no C# examples at all, or they just elude me.

Any help would be greatly appreciated.

Thanks,
doug@tankoxious.com
Posted

1 solution

Your design doesn't scale.
An IP network cannot support world-directed broadcasts.
Traps should be sent to a (few) configurable addresses, possible obtained by a DNS query.
Those addresses should belong to server that can eventually expose the data to whatever client may need it.
Nothing - at that point- prohibits you to specify a subnet directed broadcast, but ... I wouldn't be the administrator of a network where such devices are present!
 
Share this answer
 
Comments
neumanndn 5-Sep-11 20:02pm    
I am going to be implementing this on a LAN not connected worldwide. Also there are a lot of current devices that broadcast status info. We currentl have OEM equipment that does this, but I would like to write this for a piece of equipment that we designed. Anyway, my question was about examples, so do you possibly know where I could find some specific ones pertinent to my question?
Emilio Garavaglia 6-Sep-11 2:20am    
If that's the case, just use UDP as a transport protocol, and use 255.255.255.255 as a "destination address".
I have in any case to insist: even in a LAN, all broadcasts a received by all the system in the network (including the ones not interested in them).
As the network grows, the number of broadcast increase and so the number of interrupts all processors will receive, resulting in broadcast storm and global poor performance.
Only poor configured networks work the way you described.

Any way, i you have to work with SNMP, the "source" is here:
http://www.net-snmp.org/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900