PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • The SNMP tables
  • OID of columns
  • Limitation
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
SNMPGetTable (Function)
In French: SNMPLitTableau
Reads a table of SNMP values.
A table of SNMP values is a two-dimensional array of strings.
Example
// Read the storage devices of local system
SessionID is int = SNMPStartSession("127.0.0.1", "public")

// OID constants for the table of devices
OIDHRSTORAGETABLE = "1.3.6.1.2.1.25.2.3"
// Number of the relevant columns in the SNMP table of devices
OIDHRSTORAGETYPE = 2
OIDHRSTORAGEDESCR = 3
OIDHRSTORAGESIZE = 5
OIDHRSTORAGEUSED = 6

sDeviceTable is array of 0 by 0 string
SNMPGetTable(SessionID, OIDHRSTORAGETABLE, sDeviceTable)
// To read the StorageSize and StorageUsed values only
// SNMPGetTable(SessionID, OIDHRSTORAGETABLE, ...
// sTableDevices, [OIDHRSTORAGESIZE, OIDHRSTORAGEUSED])

// Number of rows
nNumberRows is int = ArrayInfo(sDeviceTable, tiNumberRows)

FOR i = 1 TO nNumberRows
Trace("Device " + i)
Trace("Type " = sDeviceTable[i, OIDHRSTORAGETYPE])
Trace("Description " = sDeviceTable[i, OIDHRSTORAGEDESCR])
Trace("Size " = sDeviceTable[i, OIDHRSTORAGESIZE])
Trace("Used " = sDeviceTable[i, OIDHRSTORAGEUSED])
Trace(" ")
END
Syntax
<Result> = SNMPGetTable(<Session Identifier> , <OID of SNMP Table> , <WLanguage Array>)
<Result>: Boolean
  • True if the reading was performed,
  • False if an error occurred. ErrorInfo returns more details about the problem.
<Session Identifier>: Integer
Identifier of SNMP session, returned by SNMPStartSession.
<OID of SNMP Table>: Character string (with quotes)
Identifier of SNMP table to read. This string can correspond to the identifier in numeric format or in text format (the MIB file that describes the OID must have been loaded by SNMPLoadMIB).
<WLanguage Array>: Array variable (two-dimensional array of strings)
When the function is run, this WLanguage array is assigned with the values of the SNMP table. The rows are the elements of the table (from 1 to the total number of elements). The columns are the attributes (from 1 to the number of table attributes). For example: <WLanguage Array> [2, 3] is the value of attribute #3 of 2nd table element.
Remarks

The SNMP tables

In SNMP, the tables have the following format:
<OID SNMP Table>.1.<OID Column 1>.<Subscript Row 1>Value 1,1
<OID SNMP Table>.1.<OID Column 1>.<Subscript Row 2>Value 2,1
<OID SNMP Table>.1.<OId Column 1>.<Subscript Row n>Value n,1
<OID SNMP Table>.1.<OID Column 2>.<Subscript Row 1>Value 1,2
<OID SNMP Table>.1.<OID Column 2>.<Subscript Row 2>Value 2,2
<OID SNMP Table>.1.<OID Column 2>.<Subscript Row n>Value n,2
...
<OID SNMP Table>.1.<OID Column m>.<Subscript Row 1>Value 1,m
<OID SNMP Table>.1.<OID Column m>.<Subscript Row 2>Value 2,m
<OID SNMP Table>.1.<OID Column m>.<Subscript Row n>Value n,m
SNMPGetTable retrieves the table in the following format:
OID column 1OID column 2...OID column m
Subscript row 1Value 1,1Value 1,2Value 1,m
Subscript row 2Value 2,1Value 2,2Value 2,m
...
Subscript row nValue n,1Value n,2Value n, m

OID of columns

We recommend that you define constants for the OID of columns (see the example).

Limitation

The SNMPxxx functions can only be used from Windows 2000 (they cannot be used with the following systems: Windows 98, Me or NT4).
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment