Skip to content
barryo edited this page Jun 11, 2012 · 6 revisions

This page describes the SNMP class and its various functions. See also the phpDoc documentation.

It should be read in conjunction with the example, Using MIBS and Caching.

SNMP Query Methods

In general, these methods all front snmp2_get() and ``snmp2_real_walk()` of the PHP SNMP extension and then parse their output.

  • get() - get a scalar value for a given OID;

  • walk1d() - get a list of values by walking a given OID. This should be a penultimate OID such that the resulting values all of the same kind (such as interface types). The associatative array returned is indexed with the last OID index. For example, a snmpwalk() on .1.3.6.1.2.1.2.2.1.7 which is interface administrative states may yield:

    .1.3.6.1.2.1.2.2.1.7.1 = INTEGER: 1 .1.3.6.1.2.1.2.2.1.7.2 = INTEGER: 1 .1.3.6.1.2.1.2.2.1.7.3 = INTEGER: 1 .1.3.6.1.2.1.2.2.1.7.7 = INTEGER: 2 .1.3.6.1.2.1.2.2.1.7.1661 = INTEGER: 2 .1.3.6.1.2.1.2.2.1.7.4337 = INTEGER: 1

For which walk1d() would return an array:

[1] => 1
[2] => 1
[3] => 1
[7] => 2
[1661] => 2
[4337] => 1
  • subOidWalk()
Clone this wiki locally