ISNMP::GetTree method

The GetTree method enables an ASP Web page to obtain the values associated with a set of subnodes beneath a specified root SNMP OID.

Syntax

HRESULT GetTree(
  [in]  BSTR    varTree,
  [out] VARIANT *varValue
);

Parameters

varTree [in]
Caller-supplied string identifying a root SNMP OID.

varValue [out]
Caller-supplied location to receive the address of a two-dimensional array containing SNMP OID strings and associated values.

Return value

Win32 error codes can also be returned.

Return code Description
S_OK The operation succeeded.
E_FAIL The ISNMP::Open method has not been called.
E_INVALIDARG The specified SNMP OID is not valid.
E_OUTOFMEMORY Out of memory.

VBScript example

This method calls the SnmpMgrRequest function to obtain the SNMP OID values for the subnodes.

The ISNMP::Open method must be called before the ISNMP::GetTree method can be called.

Dim StrIP, strCommunity, objSNMP, OIDValueArray
strIP = Session("MS_IPaddress")
strCommunity = Session ("MS_Community")
Set objSNMP = Server.CreateObject("OlePrn.OleSNMP")
objSNMP.Open strIP, strCommunity, 2, 1000
OIDValueArray = objSNMP.GetTree ("43.18.1.1.2")

Requirements

Target platform: Desktop

Header: Olesnmp.h

See also

ISNMP::Open