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
SNMPSet (Function)
In french: SNMPEcrit
Writes one or more values onto an SNMP agent for which an SNMP session was started.
Example
// Modify the name of the agent contact
SessionID is int = SNMPStartSession("127.0.0.1", "private")
sDesc is string = SNMPSet(SessionID, ".1.3.6.1.2.1.1.4", ...
"Administrator", snmpTypeString)
// Modify the name of the agent contact
SessionID is int = SNMPStartSession("127.0.0.1", "private")
// Use the MIB file
SNMPLoadMIB("c:\windows\system32\mib_ii.mib")
sDesc is string = SNMPSet(SessionID, "iso.org.dod.internet.mgmt.mib-2.system.sysContact", ...
"Administrator", snmpTypeString)
Syntax

Writing a value onto an SNMP agent Hide the details

<Result> = SNMPSet(<Session identifier> , <OID to modify> , <Type of value> , <Value to write>)
<Result>: Boolean
  • True if the modification was performed,
  • False if an error occurred.
<Session identifier>: Integer
Identifier of SNMP session, returned by SNMPStartSession.
<OID to modify>: Character string
Identifier of the SNMP object to modify. 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).
<Type of value>: Integer variable
Type of the value to modify:
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.
<Value to write>: Character string
Value of the OID to write.

Writing several values onto an SNMP agent Hide the details

<Result> = SNMPSet(<Session identifier> , <Array of OIDs to write> , <Array of types> , <Array of values>)
<Result>: Boolean
  • True if all the values have been modified,
  • False if at least one error occurred.
<Session identifier>: Integer
Identifier of SNMP session, returned by SNMPStartSession.
<Array of OIDs to write>: Array variable
Array of strings containing the OIDs to write. 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 types>: Array variable
Array of integers, containing the types of the values to write. At least one dimension of this array must be equal to <Array of OIDs to write>. 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 values>: Array variable
Array of strings containing the new values. At least one dimension of this array must be equal to <Array of OIDs to write>.
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