Login  
Search All Forums
Dart Home | PowerSNMP for .NET | Custom Development Reply | PowerSNMP for .NET Topics | Forums   
AuthorForum: PowerSNMP for .NET
Topic: Definition field in ResponseMessage Variable set to null
tgrharris
aharris@harris.com

From: Palm Bay, FL USA
Posts: 25
Member Since: 06/22/09
posted November 28, 2010 11:08 PM

Querying a table field using GetResponse (not using GetTable because I have the row index and am querying a cell in a table). When I iterate through the Variables collection, the Value property is filled in with the proper value but the Definition property is set to null. On non table OIDs, the Definition property is filled in correctly. Any thoughts?
Nick B (Admin)

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

Extra Support Options
Custom Application Development

posted November 29, 2010 4:31 PM

Hello,

Did you load in a mib file that contains a definition for the trap oids?

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

tgrharris
aharris@harris.com

From: Palm Bay, FL USA
Posts: 25
Member Since: 06/22/09
posted November 29, 2010 5:56 PM

No trap OIDs were in the MIB. Here is the line of code called in my Import method:

list.Add(new Dart.Snmp.MibNode(Dart.Snmp.Usage.TableColumn, "1.3.6.1.4.1.4466.1.2.10.1.1.1.1.1.13", "Integer { modQPSK (0), mod8PSK (1), mod16QAM (2) }", Dart.Snmp.Access.ReadWrite, Dart.Snmp.Status.Current, @"", "scIrdRcvSatelliteConfigModulation", typeof(Dart.Snmp.SimpleType.Integer), "", "", "", "", "", "", "SCOPUS-IRD", "INTEGER { modQPSK (0), mod8PSK (1), mod16QAM (2) }"));

When the response comes back from GetResponse(), the Definition field is null. For another MIB entry that has type Dart.Snmp.Usage.Object, the same call to GetResponse has a Definition attribute that is non null and reflects what was added to the MIB object.
Nick B (Admin)

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

Extra Support Options
Custom Application Development

posted November 30, 2010 8:52 AM

Hello,

What is the variable ID of the response you are looking up the definition for? It may be easiest to break in your code to get this information.

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

tgrharris
aharris@harris.com

From: Palm Bay, FL USA
Posts: 25
Member Since: 06/22/09
posted December 1, 2010 10:38 AM

I've worked around the null definition issue. What I wanted was the code that handled the message response to get access to some data about the original definition of the MIBNode entry. What I do now is use the ID property from the Variable object in the ResponseMessage and call MibNodes.GetByOid to retriev
Nick B (Admin)

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

Extra Support Options
Custom Application Development

posted December 1, 2010 2:06 PM

Can you please tell me what code you are using for the GetResponse (for your gets and sets)?
Once this information is received we can continue investigating the cause.

Thank you.
tgrharris
aharris@harris.com

From: Palm Bay, FL USA
Posts: 25
Member Since: 06/22/09
posted December 1, 2010 2:32 PM

Here is a snippet of the "get" code:

GetMessage request = new GetMessage();
request.Variables = new VariableCollection();

Variable v = new Variable(Mgr.Mib.GetByNodeName(scIrdRcvSatelliteConfigModulation));
request.Variables.Add(v);
      
ResponseMessage response = slave.GetResponse(request, Item.IPAddress, (int)Item.TransmitPort);
Mgr.Marshal(new ResponseMessage[] { response }, null);

When the message goes out it has an OID of 1.3.6.1.4.1.4466.1.2.10.1.1.1.1.1.13 which works fine for accessing the cell within a table, so to speak. 

Here a snippet of the "set" code:

SetMessage request = new SetMessage();
VariableCollection variables = new VariableCollection();
Variable varValue = new Variable(Mgr.Mib[scIrdRcvSatelliteConfigModulation
tgrharris
aharris@harris.com

From: Palm Bay, FL USA
Posts: 25
Member Since: 06/22/09
posted December 1, 2010 2:38 PM

I mean IID not OID in the previous message.
tgrharris
aharris@harris.com

From: Palm Bay, FL USA
Posts: 25
Member Since: 06/22/09
posted December 1, 2010 4:05 PM

One more thing I tried. When I look at the Usage type for TableColumn, it says:

"the Instance Identifier (IID) of the row of interest is generated by appending an indexer that is specific to the definition of the corresponding table entry"

So I tried setting the index parameter on the MibNode constructor to the row index I am trying to set. I still get a .0 appended instead of the index I set.
tgrharris
aharris@harris.com

From: Palm Bay, FL USA
Posts: 25
Member Since: 06/22/09
posted December 1, 2010 6:45 PM

Post got cut off. When I create a SetMessage object from a MibNode object, I get an IID of 1.3.6.1.4.1.4466.1.2.10.1.1.1.1.1.13.0. I know the index of the table that I want to append but see no way to get the framework to append the index on the SetMessage send.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted December 1, 2010 7:03 PM

Hi,
I am not sure I follow this thread exactly, but I am going to jump in here.

I think the issue may be that you are treating a column cell object like a non-cell object, and so you are running into problems.

First, make sure that you import table OIDs, table entry OIDs and table column OIDs into the MibNodes collection, and not specific instances of table column OIDs (the table column instances, or "cells").

With mib objects, the component knows that the object's IID is going to be the OID + ".0" so it will successfully create the PDU when variables are created from these objects. For table cells, the IID consists of the column OID plus the row indexer, which could be anything. Therefore, to successfully create a variable to add to the request, you should construct the IID from the OID + whatever row in the table you want to query.

From what you have posted, it looks like you have created the variable by retrieving the mib definition using GetByNodeName. I do not see how this could work. Instead, you should use the constructor that takes an Oid, and then do something like:

Variable v = new Variable(Mgr.Mib.GetByNodeName(Mib.NodeName.scIrdRcvSatelliteConfigModulation).Oid + ".23"));

where the table indexer is an integer and you are looking to get the cell in column 13, row 23. You would do the same for a Set, assuming the cell is read-write, as yours is.

I hope this helps with your issue,
-ken
tgrharris
aharris@harris.com

From: Palm Bay, FL USA
Posts: 25
Member Since: 06/22/09
posted December 1, 2010 10:15 PM

Ken - thanks for the reply. I was headed down the path you mentioned. The only small issue is now I have to create a SimpleTaggedType derived value. There was a constructor that took MibNode and string and used information from the MibNode to convert the string properly. I assume I'll just have to create the right derived type and pass it into the Variable object? Thanks again for the quick replies.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted December 2, 2010 1:43 PM

Hi,
You should be able to use one of the provided SimpleType.Classes, most of which have constructors that take strings.

Example code for creating a set message:
Variable v = new Variable(mibNodes.GetByNodeName(Mib.NodeName.myTableCol).Oid + ".1", new SimpleType.OctetString("My New Value");

-ken
tgrharris
aharris@harris.com

From: Palm Bay, FL USA
Posts: 25
Member Since: 06/22/09
posted December 2, 2010 1:53 PM

I saw those. I was referring to the fact that now I need to interrogate the MibNode ValueType and use a factory like method to pick which derived type (integer, octet string, etc.) constructor to use. I have a generic manager that polls for status of many different types of OIDs so it has to be done generically for any possible MibNode object. Thanks again for the help - consider this issue closed:-)
Reply | PowerSNMP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX