Search All Forums
Dart Home | PowerSNMP for .NET | Custom Development Reply | PowerSNMP for .NET Topics | Forums   
AuthorForum: PowerSNMP for .NET
Topic: Creating and sending enterprise specific traps

From: Barcelona, Spain
Posts: 10
Member Since: 12/15/08
posted July 11, 2012 7:04 AM

I am trying to use the "CreateSpecificTrapMessage" method to create a trap to send it to a manager.

However, the help about this method informs that:

"The trapName parameter is an enumeration of trap names. TrapMessages cannot be created from dynamically added traps using this method."

So, how can we define a specific trap in order that the SNMP Manager receives it with the correct Oid of the trap?

NOTE: I am using the latest Dart PowerSNMP for .NET library,
K M Drake

From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 11, 2012 5:03 PM

You can create a new TrapMessage instead of using the CreateSpecificTrapMessage convenience method.

If the mib defining your version 1 trap was parsed and nodes were generated into a MibNodes collection, the trap should be represented as a MibTrap object in that collection's Traps field. If you do not know the SpecificTrap, GenericTrap and Enterprise values for the trap, you can get these values from this object.

Hope it helps,

From: Barcelona, Spain
Posts: 10
Member Since: 12/15/08
posted July 12, 2012 11:59 AM

That's right, thanks.

From: USA
Posts: 5
Member Since: 09/14/15
posted September 14, 2015 3:54 PM

Hi, I just saw this thread. I've been using the Power SNMP library for about a week now and it is version 4.6. I'm having (I think) the same problem as perevera. I need to create a bunch of my own traps instead of using the canned coldstart, warmstart, linkdown, linkup, authenticationfailure and egpneighborloss and I am having a heck of a time.

I've parsed my MIB file but I don't see any MibTrap objects besides the 6 above that I mentioned in the agent.mib.traps.values collection. Is it obvious what I'm doing wrong?

I also added all my variables to my agent already.

I'm stuck at the part where I need to send a trap that (I think) should be created using CreateSpecificTrapMessage. The fist parameter required (trapname.enum) is kicking my butt.

Can you tell me what I'm doing wrong? There aren't any examples on any of our code on how to do this with custom traps.

Thanks in advance.
Reply | PowerSNMP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX