phpday 2027 - Call for Papers

snmp_set_mib_option

(PHP 8 >= 8.6.0)

snmp_set_mib_option — Set an option for parsing MIB files

说明

function snmp_set_mib_option(Snmp\Mib $option, bool $enable): void

Enables or disables an option that controls how the Net-SNMP library parses MIB files. These options make it possible to read MIB files that do not strictly follow the SMI syntax.

The options apply to the MIB files that are read afterwards: with snmp_read_mib(), when the MIB tree is loaded again by snmp_init_mib(), or when a module is loaded automatically from the MIB directories.

参数

option

The option to set. See Snmp\Mib for the available options.

enable

Whether to enable the option.

返回值

没有返回值。

示例

示例 #1 Reading a MIB file that uses underscores in names

<?php

snmp_set_mib_option(Snmp\Mib::AllowUnderscores, true);
snmp_read_mib('/usr/share/snmp/mibs/VENDOR-MIB.txt');

?>

参见

+添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top