Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

snmp_set_valueretrieval(3) [php man page]

SNMP_SET_VALUERETRIEVAL(3)						 1						SNMP_SET_VALUERETRIEVAL(3)

snmp_set_valueretrieval - Specify the method how the SNMP values will be returned

SYNOPSIS
bool snmp_set_valueretrieval (int $method = SNMP_VALUE_LIBRARY) DESCRIPTION
PARAMETERS
o $method - types +-------------------+---------------------------------------------------+ |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 hint. | | | | |SNMP_VALUE_OBJECT | | | | | | | The return values will be objects with the prop- | | | erties "value" and "type", where the latter is | | | one of the SNMP_OCTET_STR, SNMP_COUNTER etc. con- | | | stants. The way "value" is returned is based on | | | which one of constants SNMP_VALUE_LIBRARY, | | | SNMP_VALUE_PLAIN is set. | | | | +-------------------+---------------------------------------------------+ EXAMPLES
Example #1 Using snmp_set_valueretrieval(3) <?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 // ) // PHP 5.4+ examples 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 // ) ?> CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.4.0 | | | | | | | Constants SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY | | | may be combined with SNMP_VALUE_OBJECT resulting | | | different way of representing contents of $value | | | array element in return value of GET-function. If | | | no SNMP_VALUE_{PLAIN,LIBRARY} constant is accom- | | | panying SNMP_VALUE_OBJECT, SNMP_VALUE_LIBRARY is | | | used. Prior to 5.4.0 SNMP_VALUE_OBJECT effe- | | | cively meant SNMP_VALUE_OBJECT| SNMP_VALUE_PLAIN. | | | | +--------+---------------------------------------------------+ SEE ALSO
snmp_get_valueretrieval(3), "Predefined Constants". PHP Documentation Group SNMP_SET_VALUERETRIEVAL(3)

Check Out this Related Man Page

SNMP3_REAL_WALK(3)							 1							SNMP3_REAL_WALK(3)

snmp3_real_walk - Return all objects including their respective object ID within the specified one

SYNOPSIS
array snmp3_real_walk (string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, string $object_id, [string $timeout = 1000000], [string $retries = 5]) DESCRIPTION
The snmp3_real_walk(3) function is used to traverse over a number of SNMP objects starting from $object_id and return not only their val- ues but also their object ids. PARAMETERS
o $host - The hostname of the SNMP agent (server). o $sec_name - the security name, usually some kind of username o $sec_level - the security level (noAuthNoPriv|authNoPriv|authPriv) o $auth_protocol - the authentication protocol (MD5 or SHA) o $auth_passphrase - the authentication pass phrase o $priv_protocol - the privacy protocol (DES or AES) o $priv_passphrase - the privacy pass phrase o $object_id - The SNMP object id. o $timeout - The number of microseconds until the first timeout. o $retries - The number of times to retry if timeouts occur. RETURN VALUES
Returns an associative array of the SNMP object ids and their values on success or FALSE on error. In case of an error, an E_WARNING mes- sage is shown. EXAMPLES
Example #1 Using snmp3_real_walk(3) <?php var_export(snmp3_real_walk('localhost', 'james', 'authPriv', 'SHA', 'secret007', 'AES', 'secret007', 'IF-MIB::ifName')); ?> The above will output something like: array ( 'IF-MIB::ifName.1' => 'STRING: lo', 'IF-MIB::ifName.2' => 'STRING: eth0', 'IF-MIB::ifName.3' => 'STRING: eth2', 'IF-MIB::ifName.4' => 'STRING: sit0', 'IF-MIB::ifName.5' => 'STRING: sixxs', ) SEE ALSO
snmpwalk(3). PHP Documentation Group SNMP3_REAL_WALK(3)
Man Page