ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / SNMP Protocol functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Reads one or more values of an agent with which an SNMP session was started.
Example
// Read the description of the local system
SessionID is int = SNMPStartSession("127.0.0.1", "public")
nType is int
sDesc is string = SNMPGet(SessionID, ".1.3.6.1.2.1.1.1", nType)
// Read the description of the local system by using the MIB file
SessionID is int = SNMPStartSession("127.0.0.1", "public")
nType is int
SNMPLoadMIB("c:\windows\system32\mib_ii.mib")
sDesc is string = SNMPGet(SessionID, "iso.org.dod.internet.mgmt.mib-2.system.sysDescr", nType)
Syntax

Reading a value of an agent Hide the details

<Result> = SNMPGet(<Session identifier> , <OID to read> [, <Returned type>])
<Result>: ANSI character string
  • Value of the OID returned by the agent. The type of the value is retrieved in an integer variable (<Returned Type>).
  • Empty string ("") if an error occurred.
<Session identifier>: Integer
Identifier of SNMP session, returned by SNMPStartSession.
<OID to read>: Character string
Identifier of the SNMP object 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).
<Returned type>: Optional Integer variable
If this parameter is specified, the variable will be assigned with the type of the retrieved value. The following constants are available:
snmpTypeBitsThe OID contains bits.
snmpTypeCounter32The OID is a counter (signed integer on 32 bits).
snmpTypeCounter64The OID is a counter (signed integer on 64 bits).
snmpTypeIntegerThe OID contains an integer.
snmpTypeIPAddressThe OID contains an IP address.
snmpTypeNullThe OID is not associated with a value (a branch with child elements but without value by itself for example).
snmpTypeOIDThe OID contains an OID.
snmpTypeOpaqueThe OID contains a value that cannot be interpreted directly.
snmpTypeProgressBarThe OID contains a progress bar.
snmpTypeStringThe OID contains a string.
snmpTypeTicksThe OID contains a number of ticks.
snmpTypeUnsignedIntegerThe OID contains an unsigned integer.

Reading several values of an agent Hide the details

<Result> = SNMPGet(<Session identifier> , <Array of OIDs to read> , <Array of returned types> , <Array of returned values>)
<Result>: Boolean
  • True if all the values have been returned,
  • False if at least one error occurred.
<Session identifier>: Integer
Identifier of SNMP session, returned by SNMPStartSession.
<Array of OIDs to read>: Array variable
Array of strings containing the OIDs to read. Each OID 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).
<Array of returned types>: Array variable
Array of integers. At least one dimension of this array must be equal to <Array of OIDs to Read>. Once the function has been run, this array will contains the types of the returned values. The following constants are available:
snmpTypeBitsThe OID contains bits.
snmpTypeCounter32The OID is a counter (signed integer on 32 bits).
snmpTypeCounter64The OID is a counter (signed integer on 64 bits).
snmpTypeIntegerThe OID contains an integer.
snmpTypeIPAddressThe OID contains an IP address.
snmpTypeNullThe OID is not associated with a value (a branch with child elements but without value by itself for example).
snmpTypeOIDThe OID contains an OID.
snmpTypeOpaqueThe OID contains a value that cannot be interpreted directly.
snmpTypeProgressBarThe OID contains a progress bar.
snmpTypeStringThe OID contains a string.
snmpTypeTicksThe OID contains a number of ticks.
snmpTypeUnsignedIntegerThe OID contains an unsigned integer.
<Array of returned values>: Array variable
Array of strings. At least one dimension of this array must be equal to <Array of OIDs to Read>. Once the function has been run, this aray will contain the values returned by the SNMP agent.
Component: wd290com.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help