php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81415 Missing some SNMP::walk() values
Submitted: 2021-09-03 15:18 UTC Modified: -
From: miloslav dot hula at gmail dot com Assigned:
Status: Open Package: SNMP related
PHP Version: 8.0.10 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-09-03 15:18 UTC] miloslav dot hula at gmail dot com
Description:
------------
When walking through access points table on Cisco WLC 5508 wifi controller, not all records are in resulting array when met following conditions:

1) corresponding MIBs has to be loaded - so OID-to-name translation is working

If not, returning keys are always in numeric OID format and result is comlete.

2) oid_output_format has to be set to one of: SNMP_OID_OUTPUT_FULL, SNMP_OID_OUTPUT_MODULE, SNMP_OID_OUTPUT_SUFFIX, SNMP_OID_OUTPUT_UCD

With SNMP_OID_OUTPUT_NUMERIC everything works.

3) SNMP::walk() parameter 'suffixAsKey' has to be false (default)

If not, returning array keys are numeric OIDs and result is complete.


This bug is probably related to https://bugs.php.net/bug.php?id=76356


It seems that "named" OIDs with "binary suffix" are translated to duplicit array keys. For examle from list below:

16.189.24.198.140.96    <-- missing
220.165.244.156.215.96  <-- missing
236.225.169.240.152.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'.....`'

Every OID part outside the <32; 126> interval (readble ASCII) is translated to '.' (dot char) so resulting suffix is '.....`' which is duplicit in result.


Following list shows which access points are missing:

OID suffix               Translated OID
---------------------------------------
     12.39.36.147.113.0  AIRESPACE-WIRELESS-MIB::bsnAPName.'.'$.q.'
     12.104.3.57.182.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'.h.9.0'
   12.133.37.158.48.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'..%.0p'
    16.189.24.95.15.128  <-- missing
     16.189.24.95.21.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'..._.0'
    16.189.24.95.140.64  <-- missing
    16.189.24.95.143.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'..._.`'
    16.189.24.95.146.64  <-- missing
   16.189.24.95.147.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'..._..'
    16.189.24.95.153.64  AIRESPACE-WIRELESS-MIB::bsnAPName.'..._.@'
   16.189.24.95.155.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'..._.p'
   16.189.24.198.78.192  AIRESPACE-WIRELESS-MIB::bsnAPName.'....N.'
   16.189.24.198.108.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'....l '
   16.189.24.198.127.16  <-- missing
  16.189.24.198.138.192  <-- missing
   16.189.24.198.140.96  <-- missing
   16.189.24.198.146.48  <-- missing
   16.189.24.198.147.96  <-- missing
  16.189.24.198.149.144  <-- missing
   16.189.24.199.97.160  AIRESPACE-WIRELESS-MIB::bsnAPName.'....a.'
  16.189.24.199.123.144  AIRESPACE-WIRELESS-MIB::bsnAPName.'....{.'
   16.189.24.240.30.176  <-- missing
   16.189.24.240.158.32  <-- missing
   16.189.24.240.159.16  <-- missing
  16.189.24.240.163.128  <-- missing
   16.189.24.241.29.240  <-- missing
    16.189.24.241.37.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'....% '
     24.51.157.198.6.64  AIRESPACE-WIRELESS-MIB::bsnAPName.'.3...@'
   24.51.157.198.19.176  AIRESPACE-WIRELESS-MIB::bsnAPName.'.3....'
    24.51.157.198.63.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'.3..?`'
  24.128.144.213.98.128  AIRESPACE-WIRELESS-MIB::bsnAPName.'....b.'
  28.29.134.233.145.128  <-- missing
    28.232.93.202.209.0  AIRESPACE-WIRELESS-MIB::bsnAPName.'..]...'
   28.232.93.203.54.176  AIRESPACE-WIRELESS-MIB::bsnAPName.'..].6.'
    28.232.93.203.55.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'..].7`'
   28.232.93.203.56.208  AIRESPACE-WIRELESS-MIB::bsnAPName.'..].8.'
   28.232.93.203.59.128  AIRESPACE-WIRELESS-MIB::bsnAPName.'..].;.'
   28.232.93.203.63.144  AIRESPACE-WIRELESS-MIB::bsnAPName.'..].?.'
    32.76.158.15.42.144  AIRESPACE-WIRELESS-MIB::bsnAPName.' L..*.'
     32.76.158.15.43.32  AIRESPACE-WIRELESS-MIB::bsnAPName.' L..+ '
     32.76.158.15.44.48  AIRESPACE-WIRELESS-MIB::bsnAPName.' L..,0'
    32.76.158.15.142.96  AIRESPACE-WIRELESS-MIB::bsnAPName.' L...`'
   32.76.158.15.142.112  AIRESPACE-WIRELESS-MIB::bsnAPName.' L...p'
    44.62.207.161.31.32  AIRESPACE-WIRELESS-MIB::bsnAPName.',>... '
   52.98.136.209.143.80  AIRESPACE-WIRELESS-MIB::bsnAPName.'4b...P'
   52.189.200.145.27.16  <-- missing
  52.189.200.145.37.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'4...%p'
  52.189.200.145.45.160  AIRESPACE-WIRELESS-MIB::bsnAPName.'4...-.'
  52.189.200.145.50.160  <-- missing
  52.189.200.145.50.176  AIRESPACE-WIRELESS-MIB::bsnAPName.'4...2.'
  52.189.200.145.54.144  <-- missing
  52.189.200.145.54.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'4...6.'
   52.189.200.145.55.16  AIRESPACE-WIRELESS-MIB::bsnAPName.'4...7.'
   52.189.200.145.55.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'4...70'
   52.189.200.190.37.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'4...%0'
  52.189.200.190.132.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'4.... '
 52.189.200.190.163.224  <-- missing
 52.189.200.190.165.176  <-- missing
 52.189.200.190.179.160  <-- missing
 52.189.200.190.179.224  <-- missing
  52.189.200.190.181.16  <-- missing
   52.189.200.190.182.0  <-- missing
  52.189.200.190.183.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'4....0'
 52.189.200.190.183.128  <-- missing
 52.189.200.190.183.144  <-- missing
 52.189.200.190.183.160  <-- missing
 52.189.200.190.184.224  <-- missing
   52.189.200.190.186.0  <-- missing
 52.189.200.190.186.160  <-- missing
 52.189.200.190.187.176  <-- missing
 52.189.200.190.187.224  <-- missing
  52.189.200.190.189.80  AIRESPACE-WIRELESS-MIB::bsnAPName.'4....P'
  52.189.200.190.190.16  AIRESPACE-WIRELESS-MIB::bsnAPName.'4.....'
   52.219.253.36.96.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'4..$`.'
  52.219.253.36.103.176  AIRESPACE-WIRELESS-MIB::bsnAPName.'4..$g.'
   52.219.253.37.18.224  AIRESPACE-WIRELESS-MIB::bsnAPName.'4..%..'
    52.219.253.54.81.16  AIRESPACE-WIRELESS-MIB::bsnAPName.'4..6Q.'
    52.219.253.54.86.80  AIRESPACE-WIRELESS-MIB::bsnAPName.'4..6VP'
     52.219.253.55.3.64  AIRESPACE-WIRELESS-MIB::bsnAPName.'4..7.@'
  52.219.253.66.233.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'4..B.p'
  52.219.253.212.36.192  AIRESPACE-WIRELESS-MIB::bsnAPName.'4...$.'
    60.14.35.181.209.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'<.#.. '
   60.14.35.181.212.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'<.#...'
    76.119.109.68.11.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'LwmD. '
   76.119.109.69.52.160  AIRESPACE-WIRELESS-MIB::bsnAPName.'LwmE4.'
      80.6.4.110.54.128  AIRESPACE-WIRELESS-MIB::bsnAPName.'P..n6.'
   84.120.26.50.170.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'Tx.2..'
   84.120.26.100.71.192  AIRESPACE-WIRELESS-MIB::bsnAPName.'Tx.dG.'
    84.120.26.100.93.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'Tx.d]`'
    84.120.26.190.86.80  AIRESPACE-WIRELESS-MIB::bsnAPName.'Tx..VP'
   92.252.102.91.32.208  AIRESPACE-WIRELESS-MIB::bsnAPName.'\.f[ .'
    92.252.102.91.33.16  AIRESPACE-WIRELESS-MIB::bsnAPName.'\.f[!.'
  92.252.102.91.162.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'\.f[..'
   100.216.20.114.79.80  AIRESPACE-WIRELESS-MIB::bsnAPName.'d..rOP'
  100.216.20.114.84.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'d..rTp'
  100.216.20.114.91.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'d..r[.'
 100.216.20.114.145.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'d..r.p'
  100.216.20.114.168.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'d..r.0'
  100.216.20.114.192.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'d..r. '
 100.216.20.114.196.224  AIRESPACE-WIRELESS-MIB::bsnAPName.'d..r..'
  104.153.205.185.51.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'h...30'
 104.153.205.185.76.208  AIRESPACE-WIRELESS-MIB::bsnAPName.'h...L.'
 104.153.205.185.81.144  AIRESPACE-WIRELESS-MIB::bsnAPName.'h...Q.'
   104.153.205.185.85.0  AIRESPACE-WIRELESS-MIB::bsnAPName.'h...U.'
   124.149.243.6.60.176  <-- missing
   124.149.243.6.60.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'|...<.'
    124.149.243.6.62.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'|...> '
   124.149.243.6.62.208  AIRESPACE-WIRELESS-MIB::bsnAPName.'|...>.'
    124.149.243.6.64.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'|...@`'
  124.149.243.6.148.160  <-- missing
  124.149.243.6.148.192  <-- missing
  124.149.243.6.150.160  <-- missing
   124.149.243.6.153.48  <-- missing
  124.149.243.6.170.224  <-- missing
  124.149.243.6.236.144  <-- missing
  124.149.243.6.243.240  <-- missing
   124.149.243.6.250.80  AIRESPACE-WIRELESS-MIB::bsnAPName.'|....P'
  124.149.243.6.253.176  <-- missing
    124.149.243.6.255.0  <-- missing
   124.149.243.6.255.64  AIRESPACE-WIRELESS-MIB::bsnAPName.'|....@'
    124.149.243.7.2.208  <-- missing
     124.149.243.7.3.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'|....0'
     124.149.243.7.4.16  <-- missing
      124.149.243.7.7.0  AIRESPACE-WIRELESS-MIB::bsnAPName.'|.....'
   124.149.243.7.39.192  AIRESPACE-WIRELESS-MIB::bsnAPName.'|...'.'
   136.117.86.30.99.208  AIRESPACE-WIRELESS-MIB::bsnAPName.'.uV.c.'
   136.117.86.30.104.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'.uV.h '
  136.117.86.30.125.176  AIRESPACE-WIRELESS-MIB::bsnAPName.'.uV.}.'
  136.117.86.30.126.224  AIRESPACE-WIRELESS-MIB::bsnAPName.'.uV.~.'
  136.117.86.30.129.176  <-- missing
   136.117.86.30.130.32  <-- missing
  136.117.86.30.130.160  <-- missing
   136.117.86.30.133.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'.uV.. '
  136.117.86.30.133.144  <-- missing
  136.117.86.30.135.192  <-- missing
   136.117.86.30.136.16  AIRESPACE-WIRELESS-MIB::bsnAPName.'.uV...'
   136.117.86.30.136.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'.uV..`'
   164.24.117.88.14.208  AIRESPACE-WIRELESS-MIB::bsnAPName.'..uX..'
    164.24.117.88.17.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'..uX.0'
188.241.242.206.162.144  <-- missing
188.241.242.206.162.192  <-- missing
188.241.242.206.169.224  <-- missing
  188.241.242.207.16.64  AIRESPACE-WIRELESS-MIB::bsnAPName.'.....@'
   192.37.92.78.244.224  AIRESPACE-WIRELESS-MIB::bsnAPName.'.%\N..'
   192.37.92.78.244.224  AIRESPACE-WIRELESS-MIB::bsnAPName.'.%\N..'
   192.37.92.84.245.192  AIRESPACE-WIRELESS-MIB::bsnAPName.'.%\T..'
   196.10.203.136.24.48  <-- missing
  196.10.203.136.86.208  AIRESPACE-WIRELESS-MIB::bsnAPName.'....V.'
  196.10.203.136.99.128  AIRESPACE-WIRELESS-MIB::bsnAPName.'....c.'
  196.10.203.136.106.80  AIRESPACE-WIRELESS-MIB::bsnAPName.'....jP'
 196.10.203.160.131.160  <-- missing
     196.20.60.40.71.16  AIRESPACE-WIRELESS-MIB::bsnAPName.'..<(G.'
    196.20.60.40.82.128  AIRESPACE-WIRELESS-MIB::bsnAPName.'..<(R.'
   196.20.60.40.113.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'..<(qp'
     196.20.60.40.115.0  AIRESPACE-WIRELESS-MIB::bsnAPName.'..<(s.'
   196.20.60.40.131.160  AIRESPACE-WIRELESS-MIB::bsnAPName.'..<(..'
    196.20.60.41.95.208  AIRESPACE-WIRELESS-MIB::bsnAPName.'..<)_.'
    196.20.60.74.55.144  AIRESPACE-WIRELESS-MIB::bsnAPName.'..<J7.'
204.216.193.225.100.128  AIRESPACE-WIRELESS-MIB::bsnAPName.'....d.'
   220.140.55.181.133.0  <-- missing
 220.140.55.188.227.128  <-- missing
 220.140.55.192.158.128  AIRESPACE-WIRELESS-MIB::bsnAPName.'..7...'
  220.140.55.193.110.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'..7.n`'
 220.140.55.211.107.160  AIRESPACE-WIRELESS-MIB::bsnAPName.'..7.k.'
  220.140.55.211.116.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'..7.t '
  220.140.55.212.98.224  AIRESPACE-WIRELESS-MIB::bsnAPName.'..7.b.'
  220.165.244.101.64.64  AIRESPACE-WIRELESS-MIB::bsnAPName.'...e@@'
220.165.244.101.173.144  <-- missing
220.165.244.101.177.240  <-- missing
 220.165.244.101.194.64  AIRESPACE-WIRELESS-MIB::bsnAPName.'...e.@'
220.165.244.101.194.144  <-- missing
 220.165.244.101.195.48  <-- missing
220.165.244.101.195.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'...e.p'
 220.165.244.101.196.16  <-- missing
 220.165.244.101.211.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'...e.`'
 220.165.244.101.219.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'...e. '
220.165.244.101.220.208  <-- missing
 220.165.244.101.221.16  AIRESPACE-WIRELESS-MIB::bsnAPName.'...e..'
 220.165.244.101.221.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'...e.0'
 220.165.244.156.101.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'....e`'
220.165.244.156.109.128  AIRESPACE-WIRELESS-MIB::bsnAPName.'....m.'
 220.165.244.156.113.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'....q0'
220.165.244.156.154.240  <-- missing
 220.165.244.156.210.96  <-- missing
220.165.244.156.213.240  <-- missing
 220.165.244.156.214.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'..... '
220.165.244.156.214.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'.....p'
 220.165.244.156.215.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'.....0'
 220.165.244.156.215.96  <-- missing
 220.165.244.156.216.16  <-- missing
  220.165.244.236.6.224  <-- missing
  220.165.244.236.8.128  <-- missing
 220.165.244.236.29.160  <-- missing
 220.165.244.236.29.192  <-- missing
  220.165.244.236.30.16  <-- missing
 220.165.244.236.30.144  <-- missing
 220.165.244.236.30.176  <-- missing
 220.165.244.236.30.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'......'
 220.165.244.236.32.240  AIRESPACE-WIRELESS-MIB::bsnAPName.'.... .'
   220.165.244.236.33.0  <-- missing
  220.165.244.236.33.16  <-- missing
 220.165.244.236.33.160  AIRESPACE-WIRELESS-MIB::bsnAPName.'....!.'
 220.165.244.236.50.144  <-- missing
 220.165.244.236.50.224  AIRESPACE-WIRELESS-MIB::bsnAPName.'....2.'
  220.165.244.236.56.64  AIRESPACE-WIRELESS-MIB::bsnAPName.'....8@'
  220.235.148.79.47.160  AIRESPACE-WIRELESS-MIB::bsnAPName.'...O/.'
 236.225.169.240.152.96  AIRESPACE-WIRELESS-MIB::bsnAPName.'.....`'
 244.127.53.227.231.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'..5..p'
 244.127.53.227.238.176  AIRESPACE-WIRELESS-MIB::bsnAPName.'..5...'
   248.79.87.227.43.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'.OW.+p'
  248.79.87.227.168.112  AIRESPACE-WIRELESS-MIB::bsnAPName.'.OW..p'
   248.79.87.227.170.48  AIRESPACE-WIRELESS-MIB::bsnAPName.'.OW..0'
   248.79.87.227.174.32  AIRESPACE-WIRELESS-MIB::bsnAPName.'.OW.. '
  248.79.87.227.176.176  AIRESPACE-WIRELESS-MIB::bsnAPName.'.OW...'
   248.79.87.227.210.64  AIRESPACE-WIRELESS-MIB::bsnAPName.'.OW..@'


Test script:
---------------
<?php

foreach (glob('/home/milo/MIB/Cisco-WLC-5508/*.*') as $file) {
    if (is_file($file)) {
        snmp_read_mib((string) $file);
    }
}

$snmp = new SNMP(SNMP::VERSION_2c, 'wlc.hostname', 'public');

# without MIB
$snmp->oid_output_format = SNMP_OID_OUTPUT_FULL;    # OK
$snmp->oid_output_format = SNMP_OID_OUTPUT_NUMERIC; # OK
$snmp->oid_output_format = SNMP_OID_OUTPUT_MODULE;  # OK
$snmp->oid_output_format = SNMP_OID_OUTPUT_SUFFIX;  # OK
$snmp->oid_output_format = SNMP_OID_OUTPUT_UCD;     # OK

# with OID
#$snmp->oid_output_format = SNMP_OID_OUTPUT_FULL;    # FAILED
#$snmp->oid_output_format = SNMP_OID_OUTPUT_NUMERIC; # OK
$snmp->oid_output_format = SNMP_OID_OUTPUT_MODULE;  # FAILED
#$snmp->oid_output_format = SNMP_OID_OUTPUT_SUFFIX;  # FAILED
#$snmp->oid_output_format = SNMP_OID_OUTPUT_UCD;     # FAILED

$t = $snmp->walk('1.3.6.1.4.1.14179.2.2.1.1.3', true);
$f = $snmp->walk('1.3.6.1.4.1.14179.2.2.1.1.3', false);

echo count($t) . " - " . count($f) . "\n";



Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 20 08:03:35 2021 UTC