<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Reads and parses a MIB file into the active MIB tree</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.snmp-get-valueretrieval.html">snmp_get_valueretrieval</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.snmp-set-enum-print.html">snmp_set_enum_print</a></div> <div class="up"><a href="ref.snmp.html">SNMP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.snmp-read-mib" class="refentry"> <div class="refnamediv"> <h1 class="refname">snmp_read_mib</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">snmp_read_mib</span> — <span class="dc-title"> Reads and parses a MIB file into the active MIB tree </span></p> </div> <div class="refsect1 description" id="refsect1-function.snmp-read-mib-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>snmp_read_mib</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span> )</div> <p class="para rdfs-comment"> This function is used to load additional, e.g. vendor specific, MIBs so that human readable OIDs like VENDOR-MIB::foo.1 instead of error prone numeric OIDs can be used. </p> <p class="para"> The order in which the MIBs are loaded does matter as the underlying Net-SNMP libary will print warnings if referenced objects cannot be resolved. </p> </div> <div class="refsect1 parameters" id="refsect1-function.snmp-read-mib-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">filename</code></em></span> <dd> <p class="para">The filename of the <acronym>MIB</acronym>.</p></dd> </dt> </dl> </p> </div> <div class="refsect1 examples" id="refsect1-function.snmp-read-mib-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4549"> <p><strong>Example #1 Using <span class="function"><strong>snmp_read_mib()</strong></span></strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /> print_r</span><span style="color: #007700">( </span><span style="color: #0000BB">snmprealwalk</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">, </span><span style="color: #DD0000">'public'</span><span style="color: #007700">, </span><span style="color: #DD0000">'.1.3.6.1.2.1.2.3.4.5'</span><span style="color: #007700">) );<br /> <br /> </span><span style="color: #0000BB">snmp_read_mib</span><span style="color: #007700">(</span><span style="color: #DD0000">'./FOO-BAR-MIB.txt'</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">print_r</span><span style="color: #007700">( </span><span style="color: #0000BB">snmprealwalk</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">, </span><span style="color: #DD0000">'public'</span><span style="color: #007700">, </span><span style="color: #DD0000">'FOO-BAR-MIB::someTable' </span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> <p class="para"> The above example is made up but the results would look like: <div class="cdata"><pre> Array ( [iso.3.6.1.2.1.2.3.4.5.0] => Gauge32: 6 ) Array ( [FOO-BAR-MIB::someTable.0] => Gauge32: 6 ) </pre></div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.snmp-get-valueretrieval.html">snmp_get_valueretrieval</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.snmp-set-enum-print.html">snmp_set_enum_print</a></div> <div class="up"><a href="ref.snmp.html">SNMP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>