snmp_set_oid_output_format
(PHP 5 >= 5.2.0)
snmp_set_oid_output_format — Set the OID output format
Описание
void snmp_set_oid_output_format
( int $oid_format
)
snmp_set_oid_output_format() sets the output format to be full or numeric.
Список параметров
- oid_format
-
Set it to SNMP_OID_OUTPUT_FULL if you want a full output, SNMP_OID_OUTPUT_NUMERIC otherwise.
Возвращаемые значения
Эта функция не возвращает значения после выполнения.
Примечания
Замечание: snmp_set_oid_output_format() is only available when using the UCD SNMP library. This function is not available when using the Windows SNMP library.
- snmp_get_quick_print
- snmp_get_valueretrieval
- snmp_read_mib
- snmp_set_enum_print
- snmp_set_oid_numeric_print
- snmp_set_oid_output_format
- snmp_set_quick_print
- snmp_set_valueretrieval
- snmp2_get
- snmp2_getnext
- snmp2_real_walk
- snmp2_set
- snmp2_walk
- snmp3_get
- snmp3_getnext
- snmp3_real_walk
- snmp3_set
- snmp3_walk
- snmpget
- snmpgetnext
- snmprealwalk
- snmpset
- snmpwalk
- snmpwalkoid
Коментарии
There seems to be more than SNMP_OID_OUTPUT_FULL and SNMP_OID_OUTPUT_NUMERIC.
For example, when I walk on BRIDGE-MIB::dot1dTpFdbPort without setting the output format and var_dump the result, I get output like:
["BRIDGE-MIB::dot1dTpFdbPort.'..F8.7'"]=>
string(2) "52"
When I set it to NUMERIC, I get what I expected:
[".1.3.6.1.2.1.17.4.3.1.2.244.206.70.56.24.55"]=>
string(2) "52"
When I set it to FULL, I get even more (line-wrapped manually):
[".iso.org.dod.internet.mgmt.mib-2 .dot1dBridge.dot1dTp .dot1dTpFdbTable .dot1dTpFdbEntry .dot1dTpFdbPort. '..F8.7'"]=>
string(2) "52"
/******************** Loading Mibs **************/
$mib_path='/usr/share/snmp/mibs/ietf/';
if ($handle = opendir($mib_path))
{ echo "Directory handle: $handle <br>";
echo "Files: <br>";
while (false !== ($file = readdir($handle)))
{ if($file!='.')
{ if($file!='..')
{ echo "Read : ";
echo "$mib_path"."$file";
if(snmp_read_mib($mib_path.$file)) echo " Succesful <br>";
else echo " Failed <br>";
}
}
}
}
//load only one dir