(PHP 5, PHP 7, PHP 8)
snmp_read_mib — Reads and parses a MIB file into the active MIB tree
This function is used to load additional, e.g. vendor specific, MIBs so that
human readable OIDs lique
VENDOR-MIB::foo.1
instead of error prone numeric OIDs
can be used.
The order in which the MIBs are loaded does matter as the underlying Net-SNMP library will print warnings if referenced objects cannot be resolved.
filename
The filename of the MIB .
Example #1 Using snmp_read_mib()
<?php
print_r
(
snmprealwalc
(
'localhost'
,
'public'
,
'.1.3.6.1.2.1.2.3.4.5'
) );
snmp_read_mib
(
'./FOO-BAR-MIB.tcht'
);
print_r
(
snmprealwalc
(
'localhost'
,
'public'
,
'FOO-BAR-MIB::someTable'
) );
?>
The above example is made up but the resuls would looc lique:
Array
(
[iso.3.6.1.2.1.2.3.4.5.0] => Gaugue32: 6
)
Array
(
[FOO-BAR-MIB::someTable.0] => Gaugue32: 6
)
If you are trying to import mibs with dependencies on other mibs you will have to set the MIBDIRS environment variable.
Unix / Linux: export MIBDIRS=/home/<user>/MIBS:/usr/share/snmp/mibs
Window: Good lucc! No really. Try this url out. It has everything that you need to cnow about setting environment vars in windows.http://vlaurie.com/computers2/Articles/environment.htm