123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683 |
- <!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
- <meta charset="utf-8">
- <title>OSS_SNMP » \OSS_SNMP\SNMP</title>
- <meta name="author" content="Mike van Riel">
- <meta name="description" content="">
- <link href="../css/template.css" rel="stylesheet" media="all">
- <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
- <link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
- <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
- <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
- </head>
- <body>
- <div class="navbar navbar-fixed-top">
- <div class="navbar-inner"><div class="container">
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">OSS_SNMP</a><div class="nav-collapse"><ul class="nav">
- <li class="dropdown">
- <a href="#api" class="dropdown-toggle" data-toggle="dropdown">
- API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
- <li><a>Namespaces</a></li>
- <li><a href="../namespaces/OSS_SNMP.html"><i class="icon-th"></i> OSS_SNMP</a></li>
- </ul>
- </li>
- <li class="dropdown" id="charts-menu">
- <a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
- Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
- </li>
- <li class="dropdown" id="reports-menu">
- <a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
- Reports <b class="caret"></b></a><ul class="dropdown-menu">
- <li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors
- <span class="label label-info">39</span></a></li>
- <li><a href="../markers.html"><i class="icon-map-marker"></i> Markers
- <ul><li>todo
- <span class="label label-info">1</span>
- </li></ul></a></li>
- <li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements
- <span class="label label-info">0</span></a></li>
- </ul>
- </li>
- </ul></div>
- </div></div>
- <div class="go_to_top"><a href="#___" style="color: inherit">Back to top <i class="icon-upload icon-white"></i></a></div>
- </div>
- <div id="___" class="container">
- <noscript><div class="alert alert-warning">
- Javascript is disabled; several features are only available
- if Javascript is enabled.
- </div></noscript>
- <div class="row">
- <div class="span4">
- <span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
- <button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
- </div>
- <ul class="side-nav nav nav-list">
- <li class="nav-header">
- <i class="icon-custom icon-method"></i> Methods</li>
- <li class="method public "><a href="#__call" title="__call :: Magic method for generic function calls"><span class="description">Magic method for generic function calls</span><pre>__call()</pre></a></li>
- <li class="method public "><a href="#__construct" title="__construct :: The constructor."><span class="description">The constructor.</span><pre>__construct()</pre></a></li>
- <li class="method public "><a href="#cache" title="cache :: Query whether we are using the cache or not"><span class="description">Query whether we are using the cache or not</span><pre>cache()</pre></a></li>
- <li class="method public "><a href="#disableCache" title="disableCache :: Disable lookups of the local cache"><span class="description">Disable lookups of the local cache</span><pre>disableCache()</pre></a></li>
- <li class="method public "><a href="#enableCache" title="enableCache :: Enable lookups of the local cache"><span class="description">Enable lookups of the local cache</span><pre>enableCache()</pre></a></li>
- <li class="method public "><a href="#get" title="get :: Get a single SNMP value"><span class="description">Get a single SNMP value</span><pre>get()</pre></a></li>
- <li class="method public "><a href="#getCache" title="getCache :: Get the cache in use (or create a Cache\Basic instance"><span class="description">Get the cache in use (or create a Cache\Basic instance</span><pre>getCache()</pre></a></li>
- <li class="method public "><a href="#getCommunity" title="getCommunity :: Returns the community string currently in use."><span class="description">Returns the community string currently in use.</span><pre>getCommunity()</pre></a></li>
- <li class="method public "><a href="#getHost" title="getHost :: Returns the target host as currently configured for SNMP queries"><span class="description">Returns the target host as currently configured for SNMP queries</span><pre>getHost()</pre></a></li>
- <li class="method public "><a href="#getLastResult" title="getLastResult :: Returns the unaltered original last SNMP result"><span class="description">Returns the unaltered original last SNMP result</span><pre>getLastResult()</pre></a></li>
- <li class="method public "><a href="#getResultCache" title="getResultCache :: Returns the internal result cache"><span class="description">Returns the internal result cache</span><pre>getResultCache()</pre></a></li>
- <li class="method public "><a href="#getRetry" title="getRetry :: Returns the SNMP query retry count"><span class="description">Returns the SNMP query retry count</span><pre>getRetry()</pre></a></li>
- <li class="method public "><a href="#getTimeout" title="getTimeout :: Returns the SNMP query timeout (microseconds)."><span class="description">Returns the SNMP query timeout (microseconds).</span><pre>getTimeout()</pre></a></li>
- <li class="method public "><a href="#parseSnmpValue" title="parseSnmpValue :: Parse the result of an SNMP query into a PHP type"><span class="description">Parse the result of an SNMP query into a PHP type</span><pre>parseSnmpValue()</pre></a></li>
- <li class="method public "><a href="#ppTruthValue" title="ppTruthValue :: Utility function to convert TruthValue SNMP responses to true / false"><span class="description">Utility function to convert TruthValue SNMP responses to true / false</span><pre>ppTruthValue()</pre></a></li>
- <li class="method public "><a href="#realWalk" title="realWalk :: Proxy to the snmp2_real_walk command"><span class="description">Proxy to the snmp2_real_walk command</span><pre>realWalk()</pre></a></li>
- <li class="method public "><a href="#setCache" title="setCache :: Set the cache to use"><span class="description">Set the cache to use</span><pre>setCache()</pre></a></li>
- <li class="method public "><a href="#setCommunity" title="setCommunity :: Sets the community string to use for SNMP queries."><span class="description">Sets the community string to use for SNMP queries.</span><pre>setCommunity()</pre></a></li>
- <li class="method public "><a href="#setHost" title="setHost :: Sets the target host for SNMP queries."><span class="description">Sets the target host for SNMP queries.</span><pre>setHost()</pre></a></li>
- <li class="method public "><a href="#setOidOutputFormat" title="setOidOutputFormat :: Sets the output format for SNMP queries."><span class="description">Sets the output format for SNMP queries.</span><pre>setOidOutputFormat()</pre></a></li>
- <li class="method public "><a href="#setRetry" title="setRetry :: Sets the SNMP query retry count."><span class="description">Sets the SNMP query retry count.</span><pre>setRetry()</pre></a></li>
- <li class="method public "><a href="#setTimeout" title="setTimeout :: Sets the timeout to use for SNMP queries (microseconds)."><span class="description">Sets the timeout to use for SNMP queries (microseconds).</span><pre>setTimeout()</pre></a></li>
- <li class="method public "><a href="#subOidWalk" title="subOidWalk :: Get indexed SNMP values where the array key is the given position of the OID"><span class="description">Get indexed SNMP values where the array key is the given position of the OID</span><pre>subOidWalk()</pre></a></li>
- <li class="method public "><a href="#translate" title="translate :: Utility function to translate one value(s) to another via an associated array"><span class="description">Utility function to translate one value(s) to another via an associated array</span><pre>translate()</pre></a></li>
- <li class="method public "><a href="#useExtension" title="useExtension :: This is the MIB Extension magic"><span class="description">This is the MIB Extension magic</span><pre>useExtension()</pre></a></li>
- <li class="method public "><a href="#walk1d" title="walk1d :: Get indexed SNMP values (first degree)"><span class="description">Get indexed SNMP values (first degree)</span><pre>walk1d()</pre></a></li>
- <li class="method public "><a href="#walkIPv4" title="walkIPv4 :: Get indexed SNMP values where they are indexed by IPv4 addresses"><span class="description">Get indexed SNMP values where they are indexed by IPv4 addresses</span><pre>walkIPv4()</pre></a></li>
- <li class="nav-header">
- <i class="icon-custom icon-property"></i> Properties</li>
- <li class="property public "><a href="#%24SNMP_TRUTHVALUES" title="$SNMP_TRUTHVALUES :: "><span class="description">$SNMP_TRUTHVALUES</span><pre>$SNMP_TRUTHVALUES</pre></a></li>
- <li class="nav-header protected">» Protected</li>
- <li class="property protected "><a href="#%24_cache" title="$_cache :: "><span class="description">$_cache</span><pre>$_cache</pre></a></li>
- <li class="property protected "><a href="#%24_community" title="$_community :: "><span class="description">$_community</span><pre>$_community</pre></a></li>
- <li class="property protected "><a href="#%24_disableCache" title="$_disableCache :: "><span class="description">$_disableCache</span><pre>$_disableCache</pre></a></li>
- <li class="property protected "><a href="#%24_host" title="$_host :: "><span class="description">$_host</span><pre>$_host</pre></a></li>
- <li class="property protected "><a href="#%24_lastResult" title="$_lastResult :: "><span class="description">$_lastResult</span><pre>$_lastResult</pre></a></li>
- <li class="property protected "><a href="#%24_retry" title="$_retry :: "><span class="description">$_retry</span><pre>$_retry</pre></a></li>
- <li class="property protected "><a href="#%24_timeout" title="$_timeout :: "><span class="description">$_timeout</span><pre>$_timeout</pre></a></li>
- <li class="nav-header">
- <i class="icon-custom icon-constant"></i> Constants</li>
- <li class="constant "><a href="#OID_OUTPUT_FULL" title="OID_OUTPUT_FULL :: "><span class="description">OID_OUTPUT_FULL</span><pre>OID_OUTPUT_FULL</pre></a></li>
- <li class="constant "><a href="#OID_OUTPUT_NUMERIC" title="OID_OUTPUT_NUMERIC :: "><span class="description">OID_OUTPUT_NUMERIC</span><pre>OID_OUTPUT_NUMERIC</pre></a></li>
- <li class="constant "><a href="#SNMP_TRUTHVALUE_FALSE" title="SNMP_TRUTHVALUE_FALSE :: "><span class="description">SNMP_TRUTHVALUE_FALSE</span><pre>SNMP_TRUTHVALUE_FALSE</pre></a></li>
- <li class="constant "><a href="#SNMP_TRUTHVALUE_TRUE" title="SNMP_TRUTHVALUE_TRUE :: "><span class="description">SNMP_TRUTHVALUE_TRUE</span><pre>SNMP_TRUTHVALUE_TRUE</pre></a></li>
- </ul>
- </div>
- <div class="span8">
- <a name="%5COSS_SNMP%5CSNMP" id="\OSS_SNMP\SNMP"></a><ul class="breadcrumb">
- <li>
- <a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
- </li>
- <li><a href="../namespaces/OSS_SNMP.html">OSS_SNMP</a></li>
- <li class="active">
- <span class="divider">\</span><a href="../classes/OSS_SNMP.SNMP.html">SNMP</a>
- </li>
- </ul>
- <div href="../classes/OSS_SNMP.SNMP.html" class="element class">
- <p class="short_description">A class for performing SNMP V2 queries and processing the results.</p>
- <div class="details">
- <p class="long_description"></p>
- <table class="table table-bordered">
- <tr>
- <th>copyright</th>
- <td>Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland</td>
- </tr>
- <tr>
- <th>author</th>
- <td><a href="mailto:barry@opensolutions.ie">Barry O'Donovan</a></td>
- </tr>
- </table>
- <h3>
- <i class="icon-custom icon-method"></i> Methods</h3>
- <a name="__call" id="__call"></a><div class="element clickable method public __call" data-toggle="collapse" data-target=".__call .collapse">
- <h2>Magic method for generic function calls</h2>
- <pre>__call(string $method, array $args) </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$method</h4>
- <code>string</code>
- </div>
- <div class="subelement argument">
- <h4>$args</h4>
- <code>array</code>
- </div>
- <h3>Exceptions</h3>
- <table class="table table-bordered"><tr>
- <th><code><a href="http://php.net/manual/en/class.exception.php">\Exception</a></code></th>
- <td></td>
- </tr></table>
- </div></div>
- </div>
- <a name="__construct" id="__construct"></a><div class="element clickable method public __construct" data-toggle="collapse" data-target=".__construct .collapse">
- <h2>The constructor.</h2>
- <pre>__construct(string $host, string $community) : \OSS_SNMP</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$host</h4>
- <code>string</code><p>The target host for SNMP queries.</p></div>
- <div class="subelement argument">
- <h4>$community</h4>
- <code>string</code><p>The community to use for SNMP queries.</p></div>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
- </div></div>
- </div>
- <a name="cache" id="cache"></a><div class="element clickable method public cache" data-toggle="collapse" data-target=".cache .collapse">
- <h2>Query whether we are using the cache or not</h2>
- <pre>cache() : boolean</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>boolean</code>True of the local lookup cache is enabled. Otherwise false.</div>
- </div></div>
- </div>
- <a name="disableCache" id="disableCache"></a><div class="element clickable method public disableCache" data-toggle="collapse" data-target=".disableCache .collapse">
- <h2>Disable lookups of the local cache</h2>
- <pre>disableCache() : <a href="http://php.net/manual/en/class.snmp.php">\SNMP</a></pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code><a href="http://php.net/manual/en/class.snmp.php">\SNMP</a></code>An instance of this for fluent interfaces</div>
- </div></div>
- </div>
- <a name="enableCache" id="enableCache"></a><div class="element clickable method public enableCache" data-toggle="collapse" data-target=".enableCache .collapse">
- <h2>Enable lookups of the local cache</h2>
- <pre>enableCache() : <a href="http://php.net/manual/en/class.snmp.php">\SNMP</a></pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code><a href="http://php.net/manual/en/class.snmp.php">\SNMP</a></code>An instance of this for fluent interfaces</div>
- </div></div>
- </div>
- <a name="get" id="get"></a><div class="element clickable method public get" data-toggle="collapse" data-target=".get .collapse">
- <h2>Get a single SNMP value</h2>
- <pre>get(string $oid) : mixed</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$oid</h4>
- <code>string</code><p>The OID to get</p></div>
- <h3>Exceptions</h3>
- <table class="table table-bordered"><tr>
- <th><code><a href="../classes/OSS_SNMP.Exception.html">\OSS_SNMP\Exception</a></code></th>
- <td>On *any* SNMP error, warnings are supressed and a generic exception is thrown</td>
- </tr></table>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>mixed</code>The resultant value</div>
- </div></div>
- </div>
- <a name="getCache" id="getCache"></a><div class="element clickable method public getCache" data-toggle="collapse" data-target=".getCache .collapse">
- <h2>Get the cache in use (or create a Cache\Basic instance</h2>
- <pre>getCache() : <a href="../classes/OSS_SNMP.Cache.html">\OSS_SNMP\Cache</a></pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"><p>We kind of mandate the use of a cache as the code is written with a cache in mind.
- You are free to disable it via disableCache() but your machines may be hammered!</p>
- <p>We would suggest disableCache() / enableCache() used in pairs only when really needed.</p></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code><a href="../classes/OSS_SNMP.Cache.html">\OSS_SNMP\Cache</a></code>The cache object</div>
- </div></div>
- </div>
- <a name="getCommunity" id="getCommunity"></a><div class="element clickable method public getCommunity" data-toggle="collapse" data-target=".getCommunity .collapse">
- <h2>Returns the community string currently in use.</h2>
- <pre>getCommunity() : string</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>string</code>The community string currently in use.</div>
- </div></div>
- </div>
- <a name="getHost" id="getHost"></a><div class="element clickable method public getHost" data-toggle="collapse" data-target=".getHost .collapse">
- <h2>Returns the target host as currently configured for SNMP queries</h2>
- <pre>getHost() : string</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>string</code>The target host as currently configured for SNMP queries</div>
- </div></div>
- </div>
- <a name="getLastResult" id="getLastResult"></a><div class="element clickable method public getLastResult" data-toggle="collapse" data-target=".getLastResult .collapse">
- <h2>Returns the unaltered original last SNMP result</h2>
- <pre>getLastResult() : mixed</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>mixed</code>The unaltered original last SNMP result</div>
- </div></div>
- </div>
- <a name="getResultCache" id="getResultCache"></a><div class="element clickable method public getResultCache" data-toggle="collapse" data-target=".getResultCache .collapse">
- <h2>Returns the internal result cache</h2>
- <pre>getResultCache() : array</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>array</code>The internal result cache</div>
- </div></div>
- </div>
- <a name="getRetry" id="getRetry"></a><div class="element clickable method public getRetry" data-toggle="collapse" data-target=".getRetry .collapse">
- <h2>Returns the SNMP query retry count</h2>
- <pre>getRetry() : string</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>string</code>The SNMP query retry count</div>
- </div></div>
- </div>
- <a name="getTimeout" id="getTimeout"></a><div class="element clickable method public getTimeout" data-toggle="collapse" data-target=".getTimeout .collapse">
- <h2>Returns the SNMP query timeout (microseconds).</h2>
- <pre>getTimeout() : int</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>int</code>The the SNMP query timeout (microseconds)</div>
- </div></div>
- </div>
- <a name="parseSnmpValue" id="parseSnmpValue"></a><div class="element clickable method public parseSnmpValue" data-toggle="collapse" data-target=".parseSnmpValue .collapse">
- <h2>Parse the result of an SNMP query into a PHP type</h2>
- <pre>parseSnmpValue(string $v) : mixed</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"><p>For example, [STRING: "blah"] is parsed to a PHP string containing: blah</p></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$v</h4>
- <code>string</code><p>The value to parse</p></div>
- <h3>Exceptions</h3>
- <table class="table table-bordered"><tr>
- <th><code><a href="http://php.net/manual/en/class.exception.php">\Exception</a></code></th>
- <td></td>
- </tr></table>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>mixed</code>The parsed value</div>
- </div></div>
- </div>
- <a name="ppTruthValue" id="ppTruthValue"></a><div class="element clickable method public ppTruthValue" data-toggle="collapse" data-target=".ppTruthValue .collapse">
- <h2>Utility function to convert TruthValue SNMP responses to true / false</h2>
- <pre>ppTruthValue(integer $value) : boolean</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$value</h4>
- <code>integer</code><p>The TruthValue ( 1 => true, 2 => false) to convert</p>
- </div>
- <h3>Returns</h3>
- <div class="subelement response"><code>boolean</code></div>
- </div></div>
- </div>
- <a name="realWalk" id="realWalk"></a><div class="element clickable method public realWalk" data-toggle="collapse" data-target=".realWalk .collapse">
- <h2>Proxy to the snmp2_real_walk command</h2>
- <pre>realWalk(string $oid) : array</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$oid</h4>
- <code>string</code><p>The OID to walk</p></div>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>array</code>The results of the walk</div>
- </div></div>
- </div>
- <a name="setCache" id="setCache"></a><div class="element clickable method public setCache" data-toggle="collapse" data-target=".setCache .collapse">
- <h2>Set the cache to use</h2>
- <pre>setCache(<a href="../classes/OSS_SNMP.Cache.html">\OSS_SNMP\Cache</a> $c) : <a href="../classes/OSS_SNMP.SNMP.html">\OSS_SNMP\SNMP</a></pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$c</h4>
- <code><a href="../classes/OSS_SNMP.Cache.html">\OSS_SNMP\Cache</a></code><p>The cache to use</p></div>
- <h3>Returns</h3>
- <div class="subelement response">
- <code><a href="../classes/OSS_SNMP.SNMP.html">\OSS_SNMP\SNMP</a></code>For fluent interfaces</div>
- </div></div>
- </div>
- <a name="setCommunity" id="setCommunity"></a><div class="element clickable method public setCommunity" data-toggle="collapse" data-target=".setCommunity .collapse">
- <h2>Sets the community string to use for SNMP queries.</h2>
- <pre>setCommunity(string $c) : \OSS_SNMP</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$c</h4>
- <code>string</code><p>The community to use for SNMP queries.</p></div>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
- </div></div>
- </div>
- <a name="setHost" id="setHost"></a><div class="element clickable method public setHost" data-toggle="collapse" data-target=".setHost .collapse">
- <h2>Sets the target host for SNMP queries.</h2>
- <pre>setHost(string $h) : <a href="../classes/OSS_SNMP.SNMP.html">\OSS_SNMP\SNMP</a></pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$h</h4>
- <code>string</code><p>The target host for SNMP queries.</p></div>
- <h3>Returns</h3>
- <div class="subelement response">
- <code><a href="../classes/OSS_SNMP.SNMP.html">\OSS_SNMP\SNMP</a></code>An instance of $this (for fluent interfaces)</div>
- </div></div>
- </div>
- <a name="setOidOutputFormat" id="setOidOutputFormat"></a><div class="element clickable method public setOidOutputFormat" data-toggle="collapse" data-target=".setOidOutputFormat .collapse">
- <h2>Sets the output format for SNMP queries.</h2>
- <pre>setOidOutputFormat(int $f) : <a href="../classes/OSS_SNMP.SNMP.html">\OSS_SNMP\SNMP</a></pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"><p>Should be one of the class OID_OUTPUT_* constants</p></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$f</h4>
- <code>int</code><p>The fomat to use</p></div>
- <h3>Returns</h3>
- <div class="subelement response">
- <code><a href="../classes/OSS_SNMP.SNMP.html">\OSS_SNMP\SNMP</a></code>An instance of $this (for fluent interfaces)</div>
- </div></div>
- </div>
- <a name="setRetry" id="setRetry"></a><div class="element clickable method public setRetry" data-toggle="collapse" data-target=".setRetry .collapse">
- <h2>Sets the SNMP query retry count.</h2>
- <pre>setRetry(int $r) : \OSS_SNMP</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$r</h4>
- <code>int</code><p>The SNMP query retry count</p></div>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
- </div></div>
- </div>
- <a name="setTimeout" id="setTimeout"></a><div class="element clickable method public setTimeout" data-toggle="collapse" data-target=".setTimeout .collapse">
- <h2>Sets the timeout to use for SNMP queries (microseconds).</h2>
- <pre>setTimeout(int $t) : \OSS_SNMP</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$t</h4>
- <code>int</code><p>The timeout to use for SNMP queries (microseconds).</p>
- </div>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
- </div></div>
- </div>
- <a name="subOidWalk" id="subOidWalk"></a><div class="element clickable method public subOidWalk" data-toggle="collapse" data-target=".subOidWalk .collapse">
- <h2>Get indexed SNMP values where the array key is the given position of the OID</h2>
- <pre>subOidWalk(string $oid, int $position) : array</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"><p>I.e. the following query with sample results:</p>
- <p>subOidWalk( '.1.3.6.1.4.1.9.9.23.1.2.1.1.9', 15 )</p>
- <pre><code> .1.3.6.1.4.1.9.9.23.1.2.1.1.9.10101.5 = Hex-STRING: 00 00 00 01
- .1.3.6.1.4.1.9.9.23.1.2.1.1.9.10105.2 = Hex-STRING: 00 00 00 01
- .1.3.6.1.4.1.9.9.23.1.2.1.1.9.10108.4 = Hex-STRING: 00 00 00 01
- </code></pre>
- <p>would yield an array:</p>
- <pre><code> 10101 => Hex-STRING: 00 00 00 01
- 10105 => Hex-STRING: 00 00 00 01
- 10108 => Hex-STRING: 00 00 00 01
- </code></pre></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$oid</h4>
- <code>string</code><p>The OID to walk</p></div>
- <div class="subelement argument">
- <h4>$position</h4>
- <code>int</code><p>The position of the OID to use as the key</p></div>
- <h3>Exceptions</h3>
- <table class="table table-bordered"><tr>
- <th><code><a href="../classes/OSS_SNMP.Exception.html">\OSS_SNMP\Exception</a></code></th>
- <td>On *any* SNMP error, warnings are supressed and a generic exception is thrown</td>
- </tr></table>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>array</code>The resultant values</div>
- </div></div>
- </div>
- <a name="translate" id="translate"></a><div class="element clickable method public translate" data-toggle="collapse" data-target=".translate .collapse">
- <h2>Utility function to translate one value(s) to another via an associated array</h2>
- <pre>translate(mixed $values, array $translator) : mixed</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"><p>I.e. all elements '$value' will be replaced with $translator( $value ) where
- $translator is an associated array.</p>
- <p>Huh? Just read the code below!</p></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$values</h4>
- <code>mixed</code><p>A scalar or array or values to translate</p></div>
- <div class="subelement argument">
- <h4>$translator</h4>
- <code>array</code><p>An associated array to use to translate the values</p></div>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>mixed</code>The translated scalar or array</div>
- </div></div>
- </div>
- <a name="useExtension" id="useExtension"></a><div class="element clickable method public useExtension" data-toggle="collapse" data-target=".useExtension .collapse">
- <h2>This is the MIB Extension magic</h2>
- <pre>useExtension(string $mib, array $args) : \OSS_SNMP\MIBS</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"><p>Calling $this->useXXX_YYY_ZZZ()->fn() will instantiate
- an extension MIB class is the given name and this $this SNMP
- instance and then call fn().</p>
- <p>See the examples for more information.</p></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$mib</h4>
- <code>string</code><p>The extension class to use</p></div>
- <div class="subelement argument">
- <h4>$args</h4>
- <code>array</code>
- </div>
- <h3>Returns</h3>
- <div class="subelement response"><code>\OSS_SNMP\MIBS</code></div>
- </div></div>
- </div>
- <a name="walk1d" id="walk1d"></a><div class="element clickable method public walk1d" data-toggle="collapse" data-target=".walk1d .collapse">
- <h2>Get indexed SNMP values (first degree)</h2>
- <pre>walk1d(string $oid) : array</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"><p>Walks the SNMP tree returning an array of key => value pairs.</p>
- <p>This is a first degree walk and it will throw an exception if there is more that one degree of values.</p>
- <p>I.e. the following query with sample results:</p>
- <p>walk1d( '.1.0.8802.1.1.2.1.3.7.1.4' )</p>
- <pre><code> .1.0.8802.1.1.2.1.3.7.1.4.1 = STRING: "GigabitEthernet1/0/1"
- .1.0.8802.1.1.2.1.3.7.1.4.2 = STRING: "GigabitEthernet1/0/2"
- .1.0.8802.1.1.2.1.3.7.1.4.3 = STRING: "GigabitEthernet1/0/3"
- .....
- </code></pre>
- <p>would yield an array:</p>
- <pre><code> 1 => GigabitEthernet1/0/1
- 2 => GigabitEthernet1/0/2
- 3 => GigabitEthernet1/0/3
- </code></pre></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$oid</h4>
- <code>string</code><p>The OID to walk</p></div>
- <h3>Exceptions</h3>
- <table class="table table-bordered"><tr>
- <th><code>\OSS_SNMPException</code></th>
- <td>On *any* SNMP error, warnings are supressed and a generic exception is thrown</td>
- </tr></table>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>array</code>The resultant values</div>
- </div></div>
- </div>
- <a name="walkIPv4" id="walkIPv4"></a><div class="element clickable method public walkIPv4" data-toggle="collapse" data-target=".walkIPv4 .collapse">
- <h2>Get indexed SNMP values where they are indexed by IPv4 addresses</h2>
- <pre>walkIPv4(string $oid) : array</pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description">
- <p class="long_description"><p>I.e. the following query with sample results:</p>
- <p>subOidWalk( '.1.3.6.1.2.1.15.3.1.1. )</p>
- <pre><code> .1.3.6.1.2.1.15.3.1.1.10.20.30.4 = IpAddress: 192.168.10.10
- ...
- </code></pre>
- <p>would yield an array:</p>
- <pre><code> [10.20.30.4] => "192.168.10.10"
- ....
- </code></pre></p>
- <h3>Parameters</h3>
- <div class="subelement argument">
- <h4>$oid</h4>
- <code>string</code><p>The OID to walk</p></div>
- <h3>Exceptions</h3>
- <table class="table table-bordered"><tr>
- <th><code><a href="../classes/OSS_SNMP.Exception.html">\OSS_SNMP\Exception</a></code></th>
- <td>On *any* SNMP error, warnings are supressed and a generic exception is thrown</td>
- </tr></table>
- <h3>Returns</h3>
- <div class="subelement response">
- <code>array</code>The resultant values</div>
- </div></div>
- </div>
- <h3>
- <i class="icon-custom icon-property"></i> Properties</h3>
- <a name="%24SNMP_TRUTHVALUES" id="$SNMP_TRUTHVALUES"> </a><div class="element clickable property public $SNMP_TRUTHVALUES" data-toggle="collapse" data-target=".$SNMP_TRUTHVALUES .collapse">
- <h2>$SNMP_TRUTHVALUES</h2>
- <pre>$SNMP_TRUTHVALUES </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="%24_cache" id="$_cache"> </a><div class="element clickable property protected $_cache" data-toggle="collapse" data-target=".$_cache .collapse">
- <h2>$_cache</h2>
- <pre>$_cache </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="%24_community" id="$_community"> </a><div class="element clickable property protected $_community" data-toggle="collapse" data-target=".$_community .collapse">
- <h2>$_community</h2>
- <pre>$_community </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="%24_disableCache" id="$_disableCache"> </a><div class="element clickable property protected $_disableCache" data-toggle="collapse" data-target=".$_disableCache .collapse">
- <h2>$_disableCache</h2>
- <pre>$_disableCache </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="%24_host" id="$_host"> </a><div class="element clickable property protected $_host" data-toggle="collapse" data-target=".$_host .collapse">
- <h2>$_host</h2>
- <pre>$_host </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="%24_lastResult" id="$_lastResult"> </a><div class="element clickable property protected $_lastResult" data-toggle="collapse" data-target=".$_lastResult .collapse">
- <h2>$_lastResult</h2>
- <pre>$_lastResult </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="%24_retry" id="$_retry"> </a><div class="element clickable property protected $_retry" data-toggle="collapse" data-target=".$_retry .collapse">
- <h2>$_retry</h2>
- <pre>$_retry </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="%24_timeout" id="$_timeout"> </a><div class="element clickable property protected $_timeout" data-toggle="collapse" data-target=".$_timeout .collapse">
- <h2>$_timeout</h2>
- <pre>$_timeout </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <h3>
- <i class="icon-custom icon-constant"></i> Constants</h3>
- <a name="OID_OUTPUT_FULL" id="OID_OUTPUT_FULL"> </a><div class="element clickable constant OID_OUTPUT_FULL" data-toggle="collapse" data-target=".OID_OUTPUT_FULL .collapse">
- <h2>OID_OUTPUT_FULL</h2>
- <pre>OID_OUTPUT_FULL </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="OID_OUTPUT_NUMERIC" id="OID_OUTPUT_NUMERIC"> </a><div class="element clickable constant OID_OUTPUT_NUMERIC" data-toggle="collapse" data-target=".OID_OUTPUT_NUMERIC .collapse">
- <h2>OID_OUTPUT_NUMERIC</h2>
- <pre>OID_OUTPUT_NUMERIC </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="SNMP_TRUTHVALUE_FALSE" id="SNMP_TRUTHVALUE_FALSE"> </a><div class="element clickable constant SNMP_TRUTHVALUE_FALSE" data-toggle="collapse" data-target=".SNMP_TRUTHVALUE_FALSE .collapse">
- <h2>SNMP_TRUTHVALUE_FALSE</h2>
- <pre>SNMP_TRUTHVALUE_FALSE </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- <a name="SNMP_TRUTHVALUE_TRUE" id="SNMP_TRUTHVALUE_TRUE"> </a><div class="element clickable constant SNMP_TRUTHVALUE_TRUE" data-toggle="collapse" data-target=".SNMP_TRUTHVALUE_TRUE .collapse">
- <h2>SNMP_TRUTHVALUE_TRUE</h2>
- <pre>SNMP_TRUTHVALUE_TRUE </pre>
- <div class="labels"></div>
- <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row"><footer class="span12">
- Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
- Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a5</a> and<br>
- generated on 2012-06-22T10:05:27+01:00.<br></footer></div>
- </div>
- </body>
- </html>
|