snmp_set_mib_option

Set an option for parsing MIB files

Description

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

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.

Parameters

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

Return Values

No value is returned.

Examples

Example #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');

?>

See Also

  • snmp_read_mib
  • snmp_init_mib