snmp2_set
snmp2_set
Set the value of an SNMP object
bool **snmp2_set** string $hostname string $community $object_id $type $value int $timeout int $retries
is used to set the value of an object
specified by the .
snmp2_set``object_id
hostnameThe hostname of the agent (server).
communityThe write community.
object_idThe object id.
type``valueThe new value.
timeoutThe number of microseconds until the first timeout.
retriesThe number of times to retry if timeouts occur.
return.success
If the SNMP host rejects the data type, an E_WARNING message like "Warning: Error in packet. Reason: (badValue) The value given has the wrong type or length." is shown. If an unknown or invalid OID is specified the warning probably reads "Could not add variable".
**Voorbeeld: Using **
<?php
snmp2_set("localhost", "public", "IF-MIB::ifAlias.3", "s", "foo");
?>
Voorbeeld: Using for setting BITS object id
<?php
snmp2_set("localhost", "public", 'FOO-MIB::bar.42', 'b', '0 1 2 3 4');
// or
snmp2_set("localhost", "public", 'FOO-MIB::bar.42', 'x', 'F0');
?>
snmp2_get