Login  
Search All Forums
Dart Home | PowerSNMP for .NET | Custom Development Reply | PowerSNMP for .NET Topics | Forums   
AuthorForum: PowerSNMP for .NET
Topic: Need complete example on how to send CUSTOM trap message
ktichy

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

Hello,

I've been using the DART Power SNMP library for a week now (version 4.6) and I need a complete example on how to create my own trap message without using the canned types (coldstart, warmstart, linkdown, linkup, authenticationfailure, and egpneighborloss). How do I get an enumerated type from my own MIB definition?

I already parsed the MIB file and do have MIB Nodes for all my objects.

I already added all my variables to my Agent.

I'm having a lot of trouble with (*)
Agent.Mib.Traps.CreateSpecificTrapMessage(TrapName as System.Enum*, SysUptime as long)

I don't know where this enumerated type is supposed to be coming from. Am I in the right track to begin with? See why I need this example of how to create a custom trap message?

Any help would be appreciated. I left a message on a forum topic back from 2008 but I don't think anyone is monitoring it. So I created a new one.

Thanks in advance.
Jamie Powell (Admin)

From: Rome, NY USA
Posts: 448
Member Since: 03/13/07

Extra Support Options
Custom Application Development

posted September 15, 2015 6:12 PM

That method is only used if you have included a compiled MIB code file in your project (generated by MibNodes.GenerateCode()); the code file will contain an enumeration of all traps from the loaded MIBs, which is the enum used for trapName. You may alternatively use the Trap1Message constructor, which does not rely upon this code file. If further assistance or an example is required, please contact support@dart.com

------
-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.
------

ktichy

From: USA
Posts: 5
Member Since: 09/14/15
posted September 16, 2015 9:57 AM

Hi Jamie,

I had already generated the code through GenerateCode(). My current agent.mib has 319 objects. I can pull these individual nodes through the Mib.Nodename property. But where are the traps enumeration? When I do an agent.mib.traps.keys, I see only 6 in there!  I have added over 60 nodes in the code and they got generated by GenerateCode.

Here is a sample of one of the lines in the Import Shared Sub:

list.Add(New Dart.Snmp.MibNode(Dart.Snmp.Usage.Object, "1.3.6.1.4.1.1.37", "OctetString", Dart.Snmp.Access.ReadOnly, Dart.Snmp.Status.Current, "Code Line Server Code Line Registration", "cODE_LINE_SERVER_CODE_LINE_REGISTRATION", GetType(Dart.Snmp.SimpleType.OctetString), "", "", "", "", "", "", "Stms-traps", "OCTET STRING", ""))

Where would the enumerated trap for this be located? I can't find that anywhere.

Thanks.
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted September 18, 2015 5:03 PM

Hello,

There should be a TrapName enum in the mib.vb file generated by GenerateCode(). It should look something like this (in VB.NET):

Public Enum TrapName
myTrapName
End Enum

And should be below the Import method present in the code file. The Import method should also contain a definition for the trap that begins with:

list.Add(New Dart.Snmp.MibTrap(

If these are not present in the Mib code file, have you confirmed that your loaded MIBs contain SNMPv1 traps?
ktichy

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

No such animal there. All I have on the code that got generated was the Import function and an enumerated type called NodeName. No TrapName enum anywhere to be found. Why isn't it getting generated?
Jamie Powell (Admin)

From: Rome, NY USA
Posts: 448
Member Since: 03/13/07

Extra Support Options
Custom Application Development

posted September 21, 2015 10:14 AM

Thank you for your reply. An email has been sent to your email address for further instructions.

All the best,
Jamie
ktichy

From: USA
Posts: 5
Member Since: 09/14/15
posted September 21, 2015 10:21 AM

You mean, this one? 

"Thank you for your recent forum post. I have sent you this email offline to let you know purchase of a Subscription will be required to continue to receive technical support for your issue. Your Subscription did lapse in April 2015 and must be renewed to continue to receive priority email/forum support. Please let me know if you would like to add a Subscription to your 4 pack and I will be happy to provide you purchase and pricing information.
 
All the best,
Jamie
Jamie Jones
Business Development Associate
Voice: 315.790.5456 ext 124
Fax:  315.790.5891
jamie.powell@dart.com"
Reply | PowerSNMP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX