AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones del protocolo SNMP
  • SNMP tables
  • OID of columns
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Reads a table of SNMP values.
A table of SNMP values is a two-dimensional array of strings.
Ejemplo
// 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
Sintaxis
<Result> = SNMPGetTable(<Session identifier> , <SNMP table OID> , <WLanguage array>)
<Result>: Boolean
  • True if the reading was performed,
  • False if an error occurs. ErrorInfo returns more information on the error.
<Session identifier>: Integer
Identifier of SNMP session, returned by SNMPStartSession.
<SNMP table OID>: Character string
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: <Tableau WLangage> [2,3] is the value of attribute 3 of the 2nd element of the array.
Observaciones

SNMP tables

In SNMP, the tables have the following format:
<SNMP Table OID>.1.<Column 1 OID>.<Index Row 1>Value 1,1
<SNMP Table OID>.1.<Column 1 OID>.<Index Row 2>Value 2,1
<SNMP Table OID>.1.<Column 1 OID>.<Index Row n>Value n,1
<SNMP Table OID>.1.<Column 2 OID>.<Index Row 1>Value 1,2
<SNMP Table OID>.1.<Column 2 OID>.<Index Row 2>Value 2,2
<SNMP Table OID>.1.<Column 2 OID>.<Index Row n>Value n,2
...
<SNMP Table OID>.1.<Column m OID>.<Index Row 1>Value 1,m
<SNMP Table OID>.1.<Column m OID>.<Index Row 2>Value 2,m
<SNMP Table OID>.1.<Column m OID>.<Index Row n>Value n,m

SNMPGetTable returns the table in the following format:
OID column 1OID column 2...OID column m
Index row 1Value 1,1Value 1,2Value 1,m
Index row 2Value 2,1Value 2,2Value 2,m
...
Index 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).
Componente: wd300com.dll
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 02/05/2025

Señalar un error o enviar una sugerencia | Ayuda local