Set

Set is used to set a value to a specified OID.

Syntax

Set (oid, String)

Returns

True if successful, false otherwise.

Example

Simple SNMPSimple Network Management Protocol is a protocol for network management. It is used to collect information from network devices, such as servers, printers, hubs, switches, and routers. client that sets the sysLocation of a computer which has an SNMP server installed on it to “Malta”. Note that by default this script will always fail because generally, the public community would be set to read only:

Function Main

Dim snmp1 As Object

'Carriage return and line feed

cr = Chr(13) + Chr(10)

Set snmp1 = SNMP.Connect("127.0.0.1", "public")

'OID of the sysName

Val1 = "1.3.6.1.2.1.1.6.0"

root = "1.3.6.1.2.1.1."'OID of the systems Object

If snmp1.Set(Val1, "Malta") = true Then

echo("Value Set successfully")

Else

echo("Failed to Set value")

End If

snmp1.Close

End Function