SNMPSet

Uses the Simple Network Management Protocol (SNMP) to set a value on a target computer of network device.

Function Group Execution Windows Embedded Thin Client
SNMPSet System Info Synchronous Supported Not supported Supported

Syntax

SNMPSet( strAddress, strCommunity, strOID, Value, optNumType )
strAddress
The address of the target computer or device (e.g., "127.0.0.1" or "localhost" ).
strCommunity
The SNMP community name (e.g., "public" ) when communicating with the target computer or device.
strOID
The Object ID (OID) to be set.
Value
The value to be set to the specified OID.
optNumType
A numeric value, or a tag of Integer type, specifying the data type of Value. This is an optional parameter, but if it is included, then it must have one of following values:
Value Type Description
0 OCTETSTRING An ctet string variable
1 INTEGER32 A 32-bit signed integer variable
2 TIMETICKS A timeticks variable
3 GAUGE32 A gauge variable
4 COUNTER32 A counter variable
5 IPADDRESS An IP address variable
6 OBJECTIDENTIFIER An object identifier variable
7 SEQUENCE An ASN sequence variable
8 OPAQUE An opaque variable

Returned value

Value Description
0 No error
−1 Invalid number of parameters
−2 Invalid parameter
−3 Cannot connect to the remote machine
−4 Cannot connect to the remote machine
−5 SET operation failed
−6 Invalid OID
−7 Invalid tag name
−8 Invalid tag type
−9 This function is not supported in the current OS

Examples

Tag Name Expression
  SNMPSet( "127.0.0.1", "public", ".1.3.6.1.2.1.1.1.0", 123, 1 ) //Sets an integer value of 123 to the specified OID on the localhost (127.0.0.1).