|
|
|
|
SNMPSet (Function) In french: SNMPEcrit Writes one or more values onto an SNMP agent for which an SNMP session was started. // 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: | | snmpTypeBits | The OID contains bits. | snmpTypeCounter32 | The OID is a counter (signed integer on 32 bits). | snmpTypeCounter64 | The OID is a counter (signed integer on 64 bits). | snmpTypeInteger | The OID contains an integer. | snmpTypeIPAddress | The OID contains an IP address. | snmpTypeNull | The OID is not associated with a value (a branch with child elements but without value by itself for example). | snmpTypeOID | The OID contains an OID. | snmpTypeOpaque | The OID contains a value that cannot be interpreted directly. | snmpTypeProgressBar | The OID contains a progress bar. | snmpTypeString | The OID contains a string. | snmpTypeTicks | The OID contains a number of ticks. | snmpTypeUnsignedInteger | The 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: | | snmpTypeBits | The OID contains bits. | snmpTypeCounter32 | The OID is a counter (signed integer on 32 bits). | snmpTypeCounter64 | The OID is a counter (signed integer on 64 bits). | snmpTypeInteger | The OID contains an integer. | snmpTypeIPAddress | The OID contains an IP address. | snmpTypeNull | The OID is not associated with a value (a branch with child elements but without value by itself for example). | snmpTypeOID | The OID contains an OID. | snmpTypeOpaque | The OID contains a value that cannot be interpreted directly. | snmpTypeProgressBar | The OID contains a progress bar. | snmpTypeString | The OID contains a string. | snmpTypeTicks | The OID contains a number of ticks. | snmpTypeUnsignedInteger | The 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>.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|