public function subOidWalk($oid, $position, $elements = 1) {
        if ($this->cache() && ( $rtn = $this->getCache()->load($oid) ) !== null) {
            return $rtn;
        }

        $this->_lastResult = $this->realWalk($oid);

        if ($this->_lastResult === false) {
            $this->close();
            throw new Exception('Could not perform walk for OID ' . $oid);
        }

        $result = array();

        foreach ($this->_lastResult as $_oid => $value) {
            $oids = explode('.', $_oid);

            $index = $oids[$position];
            for ($pos = $position + 1; $pos < sizeof($oids) && ( $elements == -1 || $pos < $position + $elements ); $pos++) {
                $index .= '.' . $oids[$pos];
            }

            $result[$index] = $this->parseSnmpValue($value);
        }

        return $this->getCache()->save($oid, $result);
    }
public function subOidWalk($oid, $position, $elements = 1) {
        if ($this->cache() && ( $rtn = $this->getCache()->load($oid) ) !== null) {
            return $rtn;
        }

        $this->_lastResult = $this->realWalk($oid);

        if ($this->_lastResult === false) {
            $this->close();
            throw new Exception('Could not perform walk for OID ' . $oid);
        }

        $result = array();

        foreach ($this->_lastResult as $_oid => $value) {
            $oids = explode('.', $_oid);

            $index = $oids[$position];
            for ($pos = $position + 1; $pos < sizeof($oids) && ( $elements == -1 || $pos < $position + $elements ); $pos++) {
                $index .= '.' . $oids[$pos];
            }

            $result[$index] = $this->parseSnmpValue($value);
        }

        return $this->getCache()->save($oid, $result);
    }
public function subOidWalk ( $ oid , $ position , $ elements = 1 ) { if ( $ this -> cache ( ) && ( $ rtn = $ this -> getCache ( ) -> load ( $ oid ) ) !== null ) { return $ rtn ; } $ this -> _lastResult = $ this -> realWalk ( $ oid ) ; if ( $ this -> _lastResult === false ) { $ this -> close ( ) ; throw new Exception ( 'Could not perform walk for OID ' . $ oid ) ; } $ result = array ( ) ; foreach ( $ this -> _lastResult as $ _oid => $ value ) { $ oids = explode ( '.' , $ _oid ) ; $ index = $ oids [ $ position ] ; for ( $ pos = $ position + 1 ; $ pos < sizeof ( $ oids ) && ( $ elements == - 1 || $ pos < $ position + $ elements ) ; $ pos ++ ) { $ index .= '.' . $ oids [ $ pos ] ; } $ result [ $ index ] = $ this -> parseSnmpValue ( $ value ) ; } return $ this -> getCache ( ) -> save ( $ oid , $ result ) ; }
Get indexed SNMP values where the array key is the given position of the OID

I.e. the following query with sample results:

subOidWalk( '.1.3.6.1.4.1.9.9.23.1.2.1.1.9', 15 )


.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

would yield an array:

10101 => Hex-STRING: 00 00 00 01
10105 => Hex-STRING: 00 00 00 01
10108 => Hex-STRING: 00 00 00 01

subOidWalk( '.1.3.6.1.2.1.17.4.3.1.1', 15, -1 )

.1.3.6.1.2.1.17.4.3.1.1.0.0.136.54.152.12 = Hex-STRING: 00 00 75 33 4E 92
.1.3.6.1.2.1.17.4.3.1.1.8.3.134.58.182.16 = Hex-STRING: 00 00 75 33 4E 93
.1.3.6.1.2.1.17.4.3.1.1.0.4.121.22.55.8 = Hex-STRING: 00 00 75 33 4E 94

would yield an array:
[54.152.12] => Hex-STRING: 00 00 75 33 4E 92
[58.182.16] => Hex-STRING: 00 00 75 33 4E 93
[22.55.8]   => Hex-STRING: 00 00 75 33 4E 94

@throws \Cityware\SnmpException On *any* SNMP error, warnings are supressed and a generic exception is thrown
@param string $oid The OID to walk
@param int $position The position of the OID to use as the key
@param int $elements Number of additional elements to include in the returned array keys after $position.
This defaults to 1 meaning just the requested OID element (see examples above).
With -1, retrieves ALL to the end.
If there is less elements than $elements, return all availables (no error).

@return array The resultant values
Get indexed SNMP values where the array key is the given position of the OID