array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.snmp-set-valueretrieval.php', 1 => 'snmp_set_valueretrieval', ), 'up' => array ( 0 => 'ref.snmp.php', 1 => 'SNMP İşlevleri', ), 'prev' => array ( 0 => 'function.snmp-set-quick-print.php', 1 => 'snmp_set_quick_print', ), 'next' => array ( 0 => 'function.snmp2-get.php', 1 => 'snmp2_get', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/snmp/functions/snmp-set-valueretrieval.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.3.3, PHP 5, PHP 7, PHP 8)
snmp_set_valueretrieval — Specify the method how the SNMP values will be returned
method
SNMP_VALUE_LIBRARY | The return values will be as returned by the Net-SNMP library. |
SNMP_VALUE_PLAIN | The return values will be the plain value without the SNMP type information. |
SNMP_VALUE_OBJECT |
The return values will be objects with the properties value and type , where the latter
is one of the SNMP_OCTET_STR , SNMP_COUNTER etc. constants. The
way value is returned is based on which one of constants
SNMP_VALUE_LIBRARY , SNMP_VALUE_PLAIN is set.
|
Daima true
döndürür.
Örnek 1 Using snmp_set_valueretrieval()
<?php
snmp_set_valueretrieval(SNMP_VALUE_LIBRARY);
$ret = snmpget('localhost', 'public', 'IF-MIB::ifName.1');
// $ret = "STRING: lo"
snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
$ret = snmpget('localhost', 'public', 'IF-MIB::ifName.1');
// $ret = "lo";
snmp_set_valueretrieval(SNMP_VALUE_OBJECT);
$ret = snmpget('localhost', 'public', 'IF-MIB::ifName.1');
// stdClass Object
// (
// [type] => 4 <-- SNMP_OCTET_STR, see constants
// [value] => lo
// )
snmp_set_valueretrieval(SNMP_VALUE_OBJECT | SNMP_VALUE_PLAIN);
$ret = snmpget('localhost', 'public', 'IF-MIB::ifName.1');
// stdClass Object
// (
// [type] => 4 <-- SNMP_OCTET_STR, see constants
// [value] => lo
// )
snmp_set_valueretrieval(SNMP_VALUE_OBJECT | SNMP_VALUE_LIBRARY);
$ret = snmpget('localhost', 'public', 'IF-MIB::ifName.1');
// stdClass Object
// (
// [type] => 4 <-- SNMP_OCTET_STR, see constants
// [value] => STRING: lo
// )
?>