|
|
|
|
|
- SNMP tables
- OID of columns
Reads a table of SNMP values. A table of SNMP values is a two-dimensional array of strings.
SessionID is int = SNMPStartSession("127.0.0.1", "public")
OIDHRSTORAGETABLE = "1.3.6.1.2.1.25.2.3"
OIDHRSTORAGETYPE = 2
OIDHRSTORAGEDESCR = 3
OIDHRSTORAGESIZE = 5
OIDHRSTORAGEUSED = 6
sDeviceTable is array of 0 by 0 string
SNMPGetTable(SessionID, OIDHRSTORAGETABLE, sDeviceTable)
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 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 1 | OID column 2 | ... | OID column m | Index row 1 | Value 1,1 | Value 1,2 | | Value 1,m | Index row 2 | Value 2,1 | Value 2,2 | | Value 2,m | ... | | | | | Index row n | Value n,1 | Value n,2 | | Value n, m |
We recommend that you define constants for the OID of columns (see the example).
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|