OSS.SNMP.html 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  4. <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  5. <meta charset="utf-8">
  6. <title>phpDocumentor » \OSS\SNMP</title>
  7. <meta name="author" content="Mike van Riel">
  8. <meta name="description" content="">
  9. <link href="../css/template.css" rel="stylesheet" media="all">
  10. <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">
  11. <link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
  12. <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
  13. <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
  14. </head>
  15. <body>
  16. <div class="navbar navbar-fixed-top">
  17. <div class="navbar-inner"><div class="container">
  18. <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">phpDocumentor</a><div class="nav-collapse"><ul class="nav">
  19. <li class="dropdown">
  20. <a href="#api" class="dropdown-toggle" data-toggle="dropdown">
  21. API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
  22. <li><a>Namespaces</a></li>
  23. <li><a href="../namespaces/OSS.html"><i class="icon-th"></i> OSS</a></li>
  24. </ul>
  25. </li>
  26. <li class="dropdown" id="charts-menu">
  27. <a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
  28. 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>
  29. </li>
  30. <li class="dropdown" id="reports-menu">
  31. <a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
  32. Reports <b class="caret"></b></a><ul class="dropdown-menu">
  33. <li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors 
  34. <span class="label label-info">19</span></a></li>
  35. <li><a href="../markers.html"><i class="icon-map-marker"></i> Markers 
  36. <ul></ul></a></li>
  37. <li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements 
  38. <span class="label label-info">0</span></a></li>
  39. </ul>
  40. </li>
  41. </ul></div>
  42. </div></div>
  43. <div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div>
  44. </div>
  45. <div id="___" class="container">
  46. <noscript><div class="alert alert-warning">
  47. Javascript is disabled; several features are only available
  48. if Javascript is enabled.
  49. </div></noscript>
  50. <div class="row">
  51. <div class="span4">
  52. <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">
  53. <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>
  54. </div>
  55. <ul class="side-nav nav nav-list">
  56. <li class="nav-header">
  57. <i class="icon-custom icon-method"></i> Methods</li>
  58. <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>
  59. <li class="method public "><a href="#__construct" title="__construct :: The constructor."><span class="description">The constructor.</span><pre>__construct()</pre></a></li>
  60. <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>
  61. <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>
  62. <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>
  63. <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>
  64. <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>
  65. <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>
  66. <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>
  67. <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>
  68. <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>
  69. <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>
  70. <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>
  71. <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>
  72. <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>
  73. <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>
  74. <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>
  75. <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>
  76. <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>
  77. <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>
  78. <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>
  79. <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>
  80. <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>
  81. <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>
  82. <li class="nav-header">
  83. <i class="icon-custom icon-property"></i> Properties</li>
  84. <li class="property public "><a href="#%24SNMP_TRUTHVALUES" title="$SNMP_TRUTHVALUES :: "><span class="description">$SNMP_TRUTHVALUES</span><pre>$SNMP_TRUTHVALUES</pre></a></li>
  85. <li class="nav-header protected">» Protected</li>
  86. <li class="property protected "><a href="#%24_community" title="$_community :: "><span class="description">$_community</span><pre>$_community</pre></a></li>
  87. <li class="property protected "><a href="#%24_disableCache" title="$_disableCache :: "><span class="description">$_disableCache</span><pre>$_disableCache</pre></a></li>
  88. <li class="property protected "><a href="#%24_host" title="$_host :: "><span class="description">$_host</span><pre>$_host</pre></a></li>
  89. <li class="property protected "><a href="#%24_lastResult" title="$_lastResult :: "><span class="description">$_lastResult</span><pre>$_lastResult</pre></a></li>
  90. <li class="property protected "><a href="#%24_resultCache" title="$_resultCache :: "><span class="description">$_resultCache</span><pre>$_resultCache</pre></a></li>
  91. <li class="property protected "><a href="#%24_retry" title="$_retry :: "><span class="description">$_retry</span><pre>$_retry</pre></a></li>
  92. <li class="property protected "><a href="#%24_timeout" title="$_timeout :: "><span class="description">$_timeout</span><pre>$_timeout</pre></a></li>
  93. <li class="nav-header">
  94. <i class="icon-custom icon-constant"></i> Constants</li>
  95. <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>
  96. <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>
  97. <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>
  98. <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>
  99. </ul>
  100. </div>
  101. <div class="span8">
  102. <a name="%5COSS%5CSNMP" id="\OSS\SNMP"></a><ul class="breadcrumb">
  103. <li>
  104. <a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
  105. </li>
  106. <li><a href="../namespaces/OSS.html">OSS</a></li>
  107. <li class="active">
  108. <span class="divider">\</span><a href="../classes/OSS.SNMP.html">SNMP</a>
  109. </li>
  110. </ul>
  111. <div href="../classes/OSS.SNMP.html" class="element class">
  112. <p class="short_description">A class for performing SNMP V2 queries and processing the results.</p>
  113. <div class="details">
  114. <p class="long_description"></p>
  115. <table class="table table-bordered">
  116. <tr>
  117. <th>copyright</th>
  118. <td>Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland</td>
  119. </tr>
  120. <tr>
  121. <th>author</th>
  122. <td><a href="mailto:barry@opensolutions.ie">Barry O'Donovan</a></td>
  123. </tr>
  124. </table>
  125. <h3>
  126. <i class="icon-custom icon-method"></i> Methods</h3>
  127. <a name="__call" id="__call"></a><div class="element clickable method public __call" data-toggle="collapse" data-target=".__call .collapse">
  128. <h2>Magic method for generic function calls</h2>
  129. <pre>__call(string $method, array $args) </pre>
  130. <div class="labels"></div>
  131. <div class="row collapse"><div class="detail-description">
  132. <p class="long_description"></p>
  133. <h3>Parameters</h3>
  134. <div class="subelement argument">
  135. <h4>$method</h4>
  136. <code>string</code>
  137. </div>
  138. <div class="subelement argument">
  139. <h4>$args</h4>
  140. <code>array</code>
  141. </div>
  142. <h3>Exceptions</h3>
  143. <table class="table table-bordered"><tr>
  144. <th><code><a href="http://php.net/manual/en/class.exception.php">\Exception</a></code></th>
  145. <td></td>
  146. </tr></table>
  147. </div></div>
  148. </div>
  149. <a name="__construct" id="__construct"></a><div class="element clickable method public __construct" data-toggle="collapse" data-target=".__construct .collapse">
  150. <h2>The constructor.</h2>
  151. <pre>__construct(string $host, string $community) : \OSS_SNMP</pre>
  152. <div class="labels"></div>
  153. <div class="row collapse"><div class="detail-description">
  154. <p class="long_description"></p>
  155. <h3>Parameters</h3>
  156. <div class="subelement argument">
  157. <h4>$host</h4>
  158. <code>string</code><p>The target host for SNMP queries.</p></div>
  159. <div class="subelement argument">
  160. <h4>$community</h4>
  161. <code>string</code><p>The community to use for SNMP queries.</p></div>
  162. <h3>Returns</h3>
  163. <div class="subelement response">
  164. <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
  165. </div></div>
  166. </div>
  167. <a name="cache" id="cache"></a><div class="element clickable method public cache" data-toggle="collapse" data-target=".cache .collapse">
  168. <h2>Query whether we are using the cache or not</h2>
  169. <pre>cache() : boolean</pre>
  170. <div class="labels"></div>
  171. <div class="row collapse"><div class="detail-description">
  172. <p class="long_description"></p>
  173. <h3>Returns</h3>
  174. <div class="subelement response">
  175. <code>boolean</code>True of the local lookup cache is enabled. Otherwise false.</div>
  176. </div></div>
  177. </div>
  178. <a name="disableCache" id="disableCache"></a><div class="element clickable method public disableCache" data-toggle="collapse" data-target=".disableCache .collapse">
  179. <h2>Disable lookups of the local cache</h2>
  180. <pre>disableCache() : <a href="http://php.net/manual/en/class.snmp.php">\SNMP</a></pre>
  181. <div class="labels"></div>
  182. <div class="row collapse"><div class="detail-description">
  183. <p class="long_description"></p>
  184. <h3>Returns</h3>
  185. <div class="subelement response">
  186. <code><a href="http://php.net/manual/en/class.snmp.php">\SNMP</a></code>An instance of this for fluent interfaces</div>
  187. </div></div>
  188. </div>
  189. <a name="enableCache" id="enableCache"></a><div class="element clickable method public enableCache" data-toggle="collapse" data-target=".enableCache .collapse">
  190. <h2>Enable lookups of the local cache</h2>
  191. <pre>enableCache() : <a href="http://php.net/manual/en/class.snmp.php">\SNMP</a></pre>
  192. <div class="labels"></div>
  193. <div class="row collapse"><div class="detail-description">
  194. <p class="long_description"></p>
  195. <h3>Returns</h3>
  196. <div class="subelement response">
  197. <code><a href="http://php.net/manual/en/class.snmp.php">\SNMP</a></code>An instance of this for fluent interfaces</div>
  198. </div></div>
  199. </div>
  200. <a name="get" id="get"></a><div class="element clickable method public get" data-toggle="collapse" data-target=".get .collapse">
  201. <h2>Get a single SNMP value</h2>
  202. <pre>get(string $oid) : mixed</pre>
  203. <div class="labels"></div>
  204. <div class="row collapse"><div class="detail-description">
  205. <p class="long_description"></p>
  206. <h3>Parameters</h3>
  207. <div class="subelement argument">
  208. <h4>$oid</h4>
  209. <code>string</code><p>The OID to get</p></div>
  210. <h3>Returns</h3>
  211. <div class="subelement response">
  212. <code>mixed</code>The resultant value</div>
  213. </div></div>
  214. </div>
  215. <a name="getCommunity" id="getCommunity"></a><div class="element clickable method public getCommunity" data-toggle="collapse" data-target=".getCommunity .collapse">
  216. <h2>Returns the community string currently in use.</h2>
  217. <pre>getCommunity() : string</pre>
  218. <div class="labels"></div>
  219. <div class="row collapse"><div class="detail-description">
  220. <p class="long_description"></p>
  221. <h3>Returns</h3>
  222. <div class="subelement response">
  223. <code>string</code>The community string currently in use.</div>
  224. </div></div>
  225. </div>
  226. <a name="getHost" id="getHost"></a><div class="element clickable method public getHost" data-toggle="collapse" data-target=".getHost .collapse">
  227. <h2>Returns the target host as currently configured for SNMP queries</h2>
  228. <pre>getHost() : string</pre>
  229. <div class="labels"></div>
  230. <div class="row collapse"><div class="detail-description">
  231. <p class="long_description"></p>
  232. <h3>Returns</h3>
  233. <div class="subelement response">
  234. <code>string</code>The target host as currently configured for SNMP queries</div>
  235. </div></div>
  236. </div>
  237. <a name="getLastResult" id="getLastResult"></a><div class="element clickable method public getLastResult" data-toggle="collapse" data-target=".getLastResult .collapse">
  238. <h2>Returns the unaltered original last SNMP result</h2>
  239. <pre>getLastResult() : mixed</pre>
  240. <div class="labels"></div>
  241. <div class="row collapse"><div class="detail-description">
  242. <p class="long_description"></p>
  243. <h3>Returns</h3>
  244. <div class="subelement response">
  245. <code>mixed</code>The unaltered original last SNMP result</div>
  246. </div></div>
  247. </div>
  248. <a name="getResultCache" id="getResultCache"></a><div class="element clickable method public getResultCache" data-toggle="collapse" data-target=".getResultCache .collapse">
  249. <h2>Returns the internal result cache</h2>
  250. <pre>getResultCache() : array</pre>
  251. <div class="labels"></div>
  252. <div class="row collapse"><div class="detail-description">
  253. <p class="long_description"></p>
  254. <h3>Returns</h3>
  255. <div class="subelement response">
  256. <code>array</code>The internal result cache</div>
  257. </div></div>
  258. </div>
  259. <a name="getRetry" id="getRetry"></a><div class="element clickable method public getRetry" data-toggle="collapse" data-target=".getRetry .collapse">
  260. <h2>Returns the SNMP query retry count</h2>
  261. <pre>getRetry() : string</pre>
  262. <div class="labels"></div>
  263. <div class="row collapse"><div class="detail-description">
  264. <p class="long_description"></p>
  265. <h3>Returns</h3>
  266. <div class="subelement response">
  267. <code>string</code>The SNMP query retry count</div>
  268. </div></div>
  269. </div>
  270. <a name="getTimeout" id="getTimeout"></a><div class="element clickable method public getTimeout" data-toggle="collapse" data-target=".getTimeout .collapse">
  271. <h2>Returns the SNMP query timeout (microseconds).</h2>
  272. <pre>getTimeout() : int</pre>
  273. <div class="labels"></div>
  274. <div class="row collapse"><div class="detail-description">
  275. <p class="long_description"></p>
  276. <h3>Returns</h3>
  277. <div class="subelement response">
  278. <code>int</code>The the SNMP query timeout (microseconds)</div>
  279. </div></div>
  280. </div>
  281. <a name="parseSnmpValue" id="parseSnmpValue"></a><div class="element clickable method public parseSnmpValue" data-toggle="collapse" data-target=".parseSnmpValue .collapse">
  282. <h2>Parse the result of an SNMP query into a PHP type</h2>
  283. <pre>parseSnmpValue(string $v) : mixed</pre>
  284. <div class="labels"></div>
  285. <div class="row collapse"><div class="detail-description">
  286. <p class="long_description"><p>For example, [STRING: "blah"] is parsed to a PHP string containing: blah</p></p>
  287. <h3>Parameters</h3>
  288. <div class="subelement argument">
  289. <h4>$v</h4>
  290. <code>string</code><p>The value to parse</p></div>
  291. <h3>Exceptions</h3>
  292. <table class="table table-bordered"><tr>
  293. <th><code><a href="http://php.net/manual/en/class.exception.php">\Exception</a></code></th>
  294. <td></td>
  295. </tr></table>
  296. <h3>Returns</h3>
  297. <div class="subelement response">
  298. <code>mixed</code>The parsed value</div>
  299. </div></div>
  300. </div>
  301. <a name="ppTruthValue" id="ppTruthValue"></a><div class="element clickable method public ppTruthValue" data-toggle="collapse" data-target=".ppTruthValue .collapse">
  302. <h2>Utility function to convert TruthValue SNMP responses to true / false</h2>
  303. <pre>ppTruthValue(integer $value) : boolean</pre>
  304. <div class="labels"></div>
  305. <div class="row collapse"><div class="detail-description">
  306. <p class="long_description"></p>
  307. <h3>Parameters</h3>
  308. <div class="subelement argument">
  309. <h4>$value</h4>
  310. <code>integer</code><p>The TruthValue ( 1 => true, 2 => false) to convert</p>
  311. </div>
  312. <h3>Returns</h3>
  313. <div class="subelement response"><code>boolean</code></div>
  314. </div></div>
  315. </div>
  316. <a name="realWalk" id="realWalk"></a><div class="element clickable method public realWalk" data-toggle="collapse" data-target=".realWalk .collapse">
  317. <h2>Proxy to the snmp2_real_walk command</h2>
  318. <pre>realWalk(string $oid) : array</pre>
  319. <div class="labels"></div>
  320. <div class="row collapse"><div class="detail-description">
  321. <p class="long_description"></p>
  322. <h3>Parameters</h3>
  323. <div class="subelement argument">
  324. <h4>$oid</h4>
  325. <code>string</code><p>The OID to walk</p></div>
  326. <h3>Returns</h3>
  327. <div class="subelement response">
  328. <code>array</code>The results of the walk</div>
  329. </div></div>
  330. </div>
  331. <a name="setCommunity" id="setCommunity"></a><div class="element clickable method public setCommunity" data-toggle="collapse" data-target=".setCommunity .collapse">
  332. <h2>Sets the community string to use for SNMP queries.</h2>
  333. <pre>setCommunity(string $c) : \OSS_SNMP</pre>
  334. <div class="labels"></div>
  335. <div class="row collapse"><div class="detail-description">
  336. <p class="long_description"></p>
  337. <h3>Parameters</h3>
  338. <div class="subelement argument">
  339. <h4>$c</h4>
  340. <code>string</code><p>The community to use for SNMP queries.</p></div>
  341. <h3>Returns</h3>
  342. <div class="subelement response">
  343. <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
  344. </div></div>
  345. </div>
  346. <a name="setHost" id="setHost"></a><div class="element clickable method public setHost" data-toggle="collapse" data-target=".setHost .collapse">
  347. <h2>Sets the target host for SNMP queries.</h2>
  348. <pre>setHost(string $h) : \OSS_SNMP</pre>
  349. <div class="labels"></div>
  350. <div class="row collapse"><div class="detail-description">
  351. <p class="long_description"></p>
  352. <h3>Parameters</h3>
  353. <div class="subelement argument">
  354. <h4>$h</h4>
  355. <code>string</code><p>The target host for SNMP queries.</p></div>
  356. <h3>Returns</h3>
  357. <div class="subelement response">
  358. <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
  359. </div></div>
  360. </div>
  361. <a name="setOidOutputFormat" id="setOidOutputFormat"></a><div class="element clickable method public setOidOutputFormat" data-toggle="collapse" data-target=".setOidOutputFormat .collapse">
  362. <h2>Sets the output format for SNMP queries.</h2>
  363. <pre>setOidOutputFormat(int $f) : \OSS_SNMP</pre>
  364. <div class="labels"></div>
  365. <div class="row collapse"><div class="detail-description">
  366. <p class="long_description"><p>Should be one of the class OID_OUTPUT_* constants</p></p>
  367. <h3>Parameters</h3>
  368. <div class="subelement argument">
  369. <h4>$f</h4>
  370. <code>int</code><p>The fomat to use</p></div>
  371. <h3>Returns</h3>
  372. <div class="subelement response">
  373. <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
  374. </div></div>
  375. </div>
  376. <a name="setRetry" id="setRetry"></a><div class="element clickable method public setRetry" data-toggle="collapse" data-target=".setRetry .collapse">
  377. <h2>Sets the SNMP query retry count.</h2>
  378. <pre>setRetry(int $r) : \OSS_SNMP</pre>
  379. <div class="labels"></div>
  380. <div class="row collapse"><div class="detail-description">
  381. <p class="long_description"></p>
  382. <h3>Parameters</h3>
  383. <div class="subelement argument">
  384. <h4>$r</h4>
  385. <code>int</code><p>The SNMP query retry count</p></div>
  386. <h3>Returns</h3>
  387. <div class="subelement response">
  388. <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
  389. </div></div>
  390. </div>
  391. <a name="setTimeout" id="setTimeout"></a><div class="element clickable method public setTimeout" data-toggle="collapse" data-target=".setTimeout .collapse">
  392. <h2>Sets the timeout to use for SNMP queries (microseconds).</h2>
  393. <pre>setTimeout(int $t) : \OSS_SNMP</pre>
  394. <div class="labels"></div>
  395. <div class="row collapse"><div class="detail-description">
  396. <p class="long_description"></p>
  397. <h3>Parameters</h3>
  398. <div class="subelement argument">
  399. <h4>$t</h4>
  400. <code>int</code><p>The timeout to use for SNMP queries (microseconds).</p>
  401. </div>
  402. <h3>Returns</h3>
  403. <div class="subelement response">
  404. <code>\OSS_SNMP</code>An instance of $this (for fluent interfaces)</div>
  405. </div></div>
  406. </div>
  407. <a name="subOidWalk" id="subOidWalk"></a><div class="element clickable method public subOidWalk" data-toggle="collapse" data-target=".subOidWalk .collapse">
  408. <h2>Get indexed SNMP values where the array key is the given position of the OID</h2>
  409. <pre>subOidWalk(string $oid, int $position) : array</pre>
  410. <div class="labels"></div>
  411. <div class="row collapse"><div class="detail-description">
  412. <p class="long_description"><p>I.e. the following query with sample results:</p>
  413. <p>subOidWalk( '.1.3.6.1.4.1.9.9.23.1.2.1.1.9', 15 )</p>
  414. <pre><code> .1.3.6.1.4.1.9.9.23.1.2.1.1.9.10101.5 = Hex-STRING: 00 00 00 01
  415. .1.3.6.1.4.1.9.9.23.1.2.1.1.9.10105.2 = Hex-STRING: 00 00 00 01
  416. .1.3.6.1.4.1.9.9.23.1.2.1.1.9.10108.4 = Hex-STRING: 00 00 00 01
  417. </code></pre>
  418. <p>would yield an array:</p>
  419. <pre><code> 10101 =&gt; Hex-STRING: 00 00 00 01
  420. 10105 =&gt; Hex-STRING: 00 00 00 01
  421. 10108 =&gt; Hex-STRING: 00 00 00 01
  422. </code></pre></p>
  423. <h3>Parameters</h3>
  424. <div class="subelement argument">
  425. <h4>$oid</h4>
  426. <code>string</code><p>The OID to walk</p></div>
  427. <div class="subelement argument">
  428. <h4>$position</h4>
  429. <code>int</code><p>The position of the OID to use as the key</p></div>
  430. <h3>Returns</h3>
  431. <div class="subelement response">
  432. <code>array</code>The resultant values</div>
  433. </div></div>
  434. </div>
  435. <a name="translate" id="translate"></a><div class="element clickable method public translate" data-toggle="collapse" data-target=".translate .collapse">
  436. <h2>Utility function to translate one value(s) to another via an associated array</h2>
  437. <pre>translate(mixed $values, array $translator) : mixed</pre>
  438. <div class="labels"></div>
  439. <div class="row collapse"><div class="detail-description">
  440. <p class="long_description"><p>I.e. all elements '$value' will be replaced with $translator( $value ) where
  441. $translator is an associated array.</p>
  442. <p>Huh? Just read the code below!</p></p>
  443. <h3>Parameters</h3>
  444. <div class="subelement argument">
  445. <h4>$values</h4>
  446. <code>mixed</code><p>A scalar or array or values to translate</p></div>
  447. <div class="subelement argument">
  448. <h4>$translator</h4>
  449. <code>array</code><p>An associated array to use to translate the values</p></div>
  450. <h3>Returns</h3>
  451. <div class="subelement response">
  452. <code>mixed</code>The translated scalar or array</div>
  453. </div></div>
  454. </div>
  455. <a name="useExtension" id="useExtension"></a><div class="element clickable method public useExtension" data-toggle="collapse" data-target=".useExtension .collapse">
  456. <h2>This is the MIB Extension magic</h2>
  457. <pre>useExtension(string $mib, array $args) : \OSS\SNMP\MIBS</pre>
  458. <div class="labels"></div>
  459. <div class="row collapse"><div class="detail-description">
  460. <p class="long_description"><p>Calling $this->useXXX_YYY_ZZZ()->fn() will instantiate
  461. an extension MIB class is the given name and this $this SNMP
  462. instance and then call fn().</p>
  463. <p>See the examples for more information.</p></p>
  464. <h3>Parameters</h3>
  465. <div class="subelement argument">
  466. <h4>$mib</h4>
  467. <code>string</code><p>The extension class to use</p></div>
  468. <div class="subelement argument">
  469. <h4>$args</h4>
  470. <code>array</code>
  471. </div>
  472. <h3>Returns</h3>
  473. <div class="subelement response"><code>\OSS\SNMP\MIBS</code></div>
  474. </div></div>
  475. </div>
  476. <a name="walk1d" id="walk1d"></a><div class="element clickable method public walk1d" data-toggle="collapse" data-target=".walk1d .collapse">
  477. <h2>Get indexed SNMP values (first degree)</h2>
  478. <pre>walk1d(string $oid) : array</pre>
  479. <div class="labels"></div>
  480. <div class="row collapse"><div class="detail-description">
  481. <p class="long_description"><p>Walks the SNMP tree returning an array of key => value pairs.</p>
  482. <p>This is a first degree walk and it will throw an exception if there is more that one degree of values.</p>
  483. <p>I.e. the following query with sample results:</p>
  484. <p>walk1d( '.1.0.8802.1.1.2.1.3.7.1.4' )</p>
  485. <pre><code> .1.0.8802.1.1.2.1.3.7.1.4.1 = STRING: "GigabitEthernet1/0/1"
  486. .1.0.8802.1.1.2.1.3.7.1.4.2 = STRING: "GigabitEthernet1/0/2"
  487. .1.0.8802.1.1.2.1.3.7.1.4.3 = STRING: "GigabitEthernet1/0/3"
  488. .....
  489. </code></pre>
  490. <p>would yield an array:</p>
  491. <pre><code> 1 =&gt; GigabitEthernet1/0/1
  492. 2 =&gt; GigabitEthernet1/0/2
  493. 3 =&gt; GigabitEthernet1/0/3
  494. </code></pre></p>
  495. <h3>Parameters</h3>
  496. <div class="subelement argument">
  497. <h4>$oid</h4>
  498. <code>string</code><p>The OID to walk</p></div>
  499. <h3>Returns</h3>
  500. <div class="subelement response">
  501. <code>array</code>The resultant values</div>
  502. </div></div>
  503. </div>
  504. <h3>
  505. <i class="icon-custom icon-property"></i> Properties</h3>
  506. <a name="%24SNMP_TRUTHVALUES" id="$SNMP_TRUTHVALUES"> </a><div class="element clickable property public $SNMP_TRUTHVALUES" data-toggle="collapse" data-target=".$SNMP_TRUTHVALUES .collapse">
  507. <h2>$SNMP_TRUTHVALUES</h2>
  508. <pre>$SNMP_TRUTHVALUES </pre>
  509. <div class="labels"></div>
  510. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  511. </div>
  512. <a name="%24_community" id="$_community"> </a><div class="element clickable property protected $_community" data-toggle="collapse" data-target=".$_community .collapse">
  513. <h2>$_community</h2>
  514. <pre>$_community </pre>
  515. <div class="labels"></div>
  516. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  517. </div>
  518. <a name="%24_disableCache" id="$_disableCache"> </a><div class="element clickable property protected $_disableCache" data-toggle="collapse" data-target=".$_disableCache .collapse">
  519. <h2>$_disableCache</h2>
  520. <pre>$_disableCache </pre>
  521. <div class="labels"></div>
  522. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  523. </div>
  524. <a name="%24_host" id="$_host"> </a><div class="element clickable property protected $_host" data-toggle="collapse" data-target=".$_host .collapse">
  525. <h2>$_host</h2>
  526. <pre>$_host </pre>
  527. <div class="labels"></div>
  528. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  529. </div>
  530. <a name="%24_lastResult" id="$_lastResult"> </a><div class="element clickable property protected $_lastResult" data-toggle="collapse" data-target=".$_lastResult .collapse">
  531. <h2>$_lastResult</h2>
  532. <pre>$_lastResult </pre>
  533. <div class="labels"></div>
  534. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  535. </div>
  536. <a name="%24_resultCache" id="$_resultCache"> </a><div class="element clickable property protected $_resultCache" data-toggle="collapse" data-target=".$_resultCache .collapse">
  537. <h2>$_resultCache</h2>
  538. <pre>$_resultCache </pre>
  539. <div class="labels"></div>
  540. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  541. </div>
  542. <a name="%24_retry" id="$_retry"> </a><div class="element clickable property protected $_retry" data-toggle="collapse" data-target=".$_retry .collapse">
  543. <h2>$_retry</h2>
  544. <pre>$_retry </pre>
  545. <div class="labels"></div>
  546. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  547. </div>
  548. <a name="%24_timeout" id="$_timeout"> </a><div class="element clickable property protected $_timeout" data-toggle="collapse" data-target=".$_timeout .collapse">
  549. <h2>$_timeout</h2>
  550. <pre>$_timeout </pre>
  551. <div class="labels"></div>
  552. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  553. </div>
  554. <h3>
  555. <i class="icon-custom icon-constant"></i> Constants</h3>
  556. <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">
  557. <h2>OID_OUTPUT_FULL</h2>
  558. <pre>OID_OUTPUT_FULL </pre>
  559. <div class="labels"></div>
  560. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  561. </div>
  562. <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">
  563. <h2>OID_OUTPUT_NUMERIC</h2>
  564. <pre>OID_OUTPUT_NUMERIC </pre>
  565. <div class="labels"></div>
  566. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  567. </div>
  568. <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">
  569. <h2>SNMP_TRUTHVALUE_FALSE</h2>
  570. <pre>SNMP_TRUTHVALUE_FALSE </pre>
  571. <div class="labels"></div>
  572. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  573. </div>
  574. <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">
  575. <h2>SNMP_TRUTHVALUE_TRUE</h2>
  576. <pre>SNMP_TRUTHVALUE_TRUE </pre>
  577. <div class="labels"></div>
  578. <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
  579. </div>
  580. </div>
  581. </div>
  582. </div>
  583. </div>
  584. <div class="row"><footer class="span12">
  585. 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>
  586. Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a5</a> and<br>
  587. generated on 2012-06-08T14:43:32+01:00.<br></footer></div>
  588. </div>
  589. </body>
  590. </html>