Dart Home | PowerSNMP for ActiveX | Custom Development | Reply | PowerSNMP for ActiveX Topics | Forums |
Author | Forum: PowerSNMP for ActiveX Topic: Problem with reading a Cisco MIB... |
Deneh From: Herlong, CA USA Posts: 3 Member Since: 01/05/09 |
posted February 3, 2009 9:32 AM It seems I hit a kind of a stumbling block in coding a Cisco 3750 switch. It seems that Cisco, in coding the snmp mgmt support for this switch decided to support their interfaces,"StackPort", but not fill in all the information. ifIndex ifDescr ifType ifMTU 5179 StackPort1 53 0 5180 StackSub-St1-1 53 5181 StackSub-St1-2 53 5182 StackPort2 53 0 5183 StackSub-St2-1 53 5184 StackSub-St2-2 53 In my example; "ifIndex", "ifDescr" & "ifType" will list all of the interface values correctly. But after that, Cisco will only list "StackPort1" and StackPort2" interfaces and not place any data values for the other StackPorts. Hence, when I run the code below and build the table using PowerSNMP all the data is shifted out of place of their fields. What is a solution for this? I checked the Table entries and there all screwed up. Private Sub cmdWalkTable_Click() Dim i As Integer Dim RowString As String Dim TableOid As String Dim IPAddress As String Dim Community As String Dim v As New SnmpVariable Dim TableVariables As New SnmpVariables Dim Table As SnmpTable Dim TableRow As SnmpTableRow Dim ColOid As String Dim LastDot As Integer Dim ItemType As Integer Dim OidIndex As Integer Dim ColLen As Integer Dim ColString As String Dim MIBName As String Forms!frmSwitchApps!cmbIPAddress.SetFocus If IsNull(cmbIPAddress.Column(1)) Then ShowError ("No IP Address Selected!") Exit Sub End If IPAddress = cmbIPAddress.Column(1) Forms!frmSwitchApps!txtCommunityName.SetFocus Community = txtCommunityName.Text cmdWalkTable.Enabled = False Call CompileMibs ' ifTable will be used to get the data. Get the OID for "ifTable" TableOid = Mib.Variables.GetOIDFromName("ifTable") ' Start listening Call OpenSNMPManager ' Set the agent name Manager1.AgentName = IPAddress ' Create a new SnmpVariable, starting with the table's Oid v.Oid = TableOid '*************************************************** ' Table variable gathering section. '*************************************************** 'Send GetNext requests until end of table is reached. Do While Mid(v.Oid, 1, Len(TableOid)) = TableOid ' Clear the message and set the message as a GetNext version ltype ' After that, we will add the variable to the request and ' make sure that we are giving the correct Community On Error GoTo OnError Manager1.Message.Reset Manager1.Message.Type = TypeConstants.snmpGetNext1 Manager1.Message.Variables.Add v Manager1.Message.Community = Community ' Send the request. Manager1.Send ' Check for exception and add variable contained in the response ' to the TableVariables collection If Manager1.Message.Exception = snmpOk Then TableVariables.Add Manager1.Message.Variables(1) Else ' Exception occurred. Exit Loop Exit Do End If 'Use Oid in response for next getnext request v.Oid = Manager1.Message.Variables(1).Oid Loop '**************************************************** 'Variable gathering complete. Table creation section. '**************************************************** Set Table = TableVariables.GetTable(TableOid & ".1") ' Have to pass in TableEntry Oid (TableOid + ".1") All the data values after the "StackPorts" are shifted. |
Jason Farrar (Admin) From: Oneida, NY USA Posts: 223 Member Since: 07/24/07 Extra Support Options Custom Application Development |
posted February 3, 2009 3:56 PM This has been reported as issue #4985 You can contact Jamie Powell (jamie.powell@dart.com) for updates regarding the availability of a fix for this issue. For now the work around would be getting the table manually by sending a GetNext Message. |
Deneh From: Herlong, CA USA Posts: 3 Member Since: 01/05/09 |
posted February 3, 2009 9:48 PM Okay...Does this mean as in the code sample supplied that I use getnext instead of the snmpgetNext1 I have? Or do I individually make calls to the agent and build my own table with the results? |
Reply | PowerSNMP for ActiveX Topics | Forums |
This site is powered by
![]() |