snmp_get_valueretrieval

(PHP 4 >= 4.3.3, PHP 5, PHP 7)
Return the method how the SNMP values will be returned
int snmp_get_valueretrieval ( void )
Returns:

OR-ed combitantion of constants ( SNMP_VALUE_LIBRARY or SNMP_VALUE_PLAIN ) with possible SNMP_VALUE_OBJECT set.

Examples:
Using snmp_get_valueretrieval
<?php
 $ret = snmpget('localhost', 'public', 'IF-MIB::ifName.1');
 if (snmp_get_valueretrieval() & SNMP_VALUE_OBJECT) {
   echo $ret->value;
 } else {
   echo $ret;
 }
?>

See also:

snmp_set_valueretrieval() -

Predefined Constants -

doc_php
2016-02-24 16:09:53
Comments
Leave a Comment

Please login to continue.