PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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
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. In this case, the ErrorOccurred variable is set to True and ErrorInfo returns more details about the problem.
<Session Identifier>: Integer
Identifier of SNMP session, returned by SNMPStartSession.
<OID to Read>: Character string (with quotes)
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:
snmpTypeIPAddressThe OID contains an IP address.
snmpTypeBitsThe OID contains bits.
snmpTypeStringThe OID contains a string.
snmpTypeCounter32The OID is a counter (signed integer on 32 bits).
snmpTypeCounter64The OID is a counter (signed integer on 64 bits).
snmpTypeUnsignedIntegerThe OID contains an unsigned integer.
snmpTypeIntegerThe OID contains an integer.
snmpTypeProgressBarThe OID contains a progress bar.
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.
snmpTypeTicksThe OID contains a number of ticks.

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. ErrorInfo returns more details about the problem.
<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:
snmpTypeIPAddressThe OID contains an IP address.
snmpTypeBitsThe OID contains bits.
snmpTypeStringThe OID contains a string.
snmpTypeCounter32The OID is a counter (signed integer on 32 bits).
snmpTypeCounter64The OID is a counter (signed integer on 64 bits).
snmpTypeUnsignedIntegerThe OID contains an unsigned integer.
snmpTypeIntegerThe OID contains an integer.
snmpTypeProgressBarThe OID contains a progress bar.
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.
snmpTypeTicksThe OID contains a number of ticks.
<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.
Remarks

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 12
This page is also available for…
Comments
Click [Add] to post a comment