Ohh, yes.

This is known multi-line snmp parsing problem :(

I have not a very nice solution in my dev env, I will try to finish it..


On Wed, May 21, 2014 at 9:42 PM, Casey Dinsmore <lunitin@gmail.com> wrote:
I've discovered an issue with snmpwalk_cache_oid(). If the OID value contains a newline, explode is truncating:

$data will contain:

dot1qVlanStaticUntaggedPorts.220 = 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 
FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 
dot1qVlanForbiddenEgressPorts.481 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 

Thus:

$vlans = snmpwalk_cache_oid($device, "dot1qVlanStaticTable", array(), "Q-BRIDGE-MIB");
print_r($vlans);

    [220] => Array
        (
            [dot1qVlanStaticName] => 220
            [dot1qVlanStaticEgressPorts] => FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF
            [dot1qVlanForbiddenEgressPorts] => 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
            [dot1qVlanStaticUntaggedPorts] => 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF
            [dot1qVlanStaticRowStatus] => active
        )


Any suggestions?

Casey


_______________________________________________
observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium




--
Mike Stupalov
http://observium.org/