Login  
Search All Forums
Dart Home | PowerSNMP for .NET | Custom Development Reply | PowerSNMP for .NET Topics | Forums   
AuthorForum: PowerSNMP for .NET
Topic: Any help in framework with creating InformMessages?
andershavn

From: Denmark
Posts: 16
Member Since: 01/07/14
posted March 5, 2014 5:12 AM

Hi,

I have found Agent.Mib.Traps.CreateSpecificTrapMessage(). With this method it is possible to automatically create known traps with all their variables.
Is there a similar method to help create known Notifications/InformMessages?

Best Regards,
Anders Havn
Nick B (Admin)

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

Extra Support Options
Custom Application Development

posted March 5, 2014 3:01 PM

Hello,

This is not available for Trap2Message and InformMessage; just use the constructor for each class for similar functionality, CreateSpecificTrapMessage returns the same object that the Trap1Message constructor returns. It does not populate any variables (however, the sysUpTime portion of the PDU is populated; is this what you're referring to by variables?); any additional variables required by the trap would need to be added manually.
andershavn

From: Denmark
Posts: 16
Member Since: 01/07/14
posted March 6, 2014 10:04 AM

Hi again,

Can I somehow extract from the code file generated from the mib file, which variables should be added for a specific inform message?

list.Add(new Dart.Snmp.MibNode(Dart.Snmp.Usage.Notification, "1.3.6.1.4.1.38944.1.2.1", "", Dart.Snmp.Access.Uninitialized, Dart.Snmp.Status.Current, "", "kamDeviceStatus", null, "", "", "", "", "sysDescr, hrDeviceStatus, snmpEngineID", "", "KAMSTRUP-DEVICE-NOTIFICATION", "", ""));

/Anders
Nick B (Admin)

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

Extra Support Options
Custom Application Development

posted March 6, 2014 11:04 AM

Hello Anders,

Does your mib define which variables should be added? If it does, can you provide a link to it?
andershavn

From: Denmark
Posts: 16
Member Since: 01/07/14
posted March 7, 2014 4:51 AM

Hi,

The code line I pasted in my previous post, was auto generated from my mib. The code was generated with your tool.
Here you can see that the notification "kamDeviceStatus" contains the variable names "sysDescr, hrDeviceStatus, snmpEngineID".

/Anders
Nick B (Admin)

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

Extra Support Options
Custom Application Development

posted March 7, 2014 9:36 AM

Hello Anders,

Thank you for the clarification and the email; the OBJECTS field is exposed through the MibNode.Objects property. You can then parse the returned string to isolate the object names.
Reply | PowerSNMP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX