PHP.nl

snmpset

snmpset

Set the value of an SNMP object

bool **snmpset** string $hostname string $community  $object_id  $type  $value int $timeout int $retries
is used to set the value of an  object

specified by the . snmpset``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
  snmpset("localhost", "public", "IF-MIB::ifAlias.3", "s", "foo");
?>

Voorbeeld: Using for setting BITS object id

<?php
  snmpset("localhost", "public", 'FOO-MIB::bar.42', 'b', '0 1 2 3 4');
// or
  snmpset("localhost", "public", 'FOO-MIB::bar.42', 'x', 'F0');
?>

snmpget