From:             Gregg dot Nelson at Co dot Ramsey dot MN dot US
Operating system: ReHat 9.0
PHP version:      5.0.3
PHP Bug Type:     SNMP related
Bug description:  OID's missing from PHP snmpwalk compared with command line 
snmpwalk

Description:
------------
Running:

        PHP-5.0.3
        Net-SNMP-5.2.1
        Apache-(httpd-2.0.530)

PHP config Line

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-snmp

No changes to php.ini
-----------------------------------------------------------------------

Executing snmpwalk from command line (RH Linux 9) produces different
results from snmpwalk called from php.

I have a Cisco 6509 configured for Server Load Balancing.
The MIB tree for this starts at OID .1.3.6.1.4.1.9.9.161

With the following command from the Linux shell I get the folowing
results:
---------------------------------------------------------------------------
 snmpwalk -v2c -crmsy 192.168.108.254 .1.3.6.1.4.1.9.9.161

SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.2.0 = Counter32: 49602212
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.3.0 = Counter64: 49602212
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.4.0 = Counter32: 2776480
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.5.0 = Counter64: 2776480
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.6.0 = Counter32: 26014
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.7.0 = Counter64: 26014
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.8.0 = Counter32: 26013
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.9.0 = Counter64: 26013
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.10.0 = Counter32: 26014
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.11.0 = Counter64: 26014
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.12.0 = Counter32: 6
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.13.0 = Counter64: 6
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.14.0 = Counter32: 0
SNMPv2-SMI::enterprises.9.9.161.1.1.1.1.15.0 = Counter64: 0
SNMPv2-SMI::enterprises.9.9.161.1.2.1.1.2.0.8.67.65.70.69.84.69.83.84 =
INTEGER: 1
SNMPv2-SMI::enterprises.9.9.161.1.2.1.1.3.0.8.67.65.70.69.84.69.83.84 =
INTEGER: 3
SNMPv2-SMI::enterprises.9.9.161.1.2.1.1.4.0.8.67.65.70.69.84.69.83.84 =
Gauge32: 2
SNMPv2-SMI::enterprises.9.9.161.1.2.1.1.5.0.8.67.65.70.69.84.69.83.84 =
Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.2.1.1.6.0.8.67.65.70.69.84.69.83.84 =
INTEGER: 1
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.4.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= INTEGER: 2
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.4.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= INTEGER: 2
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.5.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.5.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.6.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.6.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.7.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 4294967295
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.7.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 4294967295
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.8.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 8
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.8.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 8
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.9.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 8
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.9.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 8
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.10.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.10.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.11.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 1
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.11.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 1
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.12.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= INTEGER: 360
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.12.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= INTEGER: 360
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.13.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 1
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.13.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 1
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.14.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 1
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.14.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 1
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.15.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.15.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.16.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Counter32: 5
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.16.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Counter32: 2
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.17.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= INTEGER: 1
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.17.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= INTEGER: 1
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.18.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Counter32: 12890
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.18.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Counter32: 13123
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.19.0.8.67.65.70.69.84.69.83.84.192.168.110.15.0
= Counter64: 12890
SNMPv2-SMI::enterprises.9.9.161.1.3.1.1.19.0.8.67.65.70.69.84.69.83.84.192.168.110.46.0
= Counter64: 13123
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.2.0.10.72.83.67.65.70.69.84.69.83.84
= INTEGER: 2
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.3.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 7
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.4.0.10.72.83.67.65.70.69.84.69.83.84
= IpAddress: 192.168.110.110
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.5.0.10.72.83.67.65.70.69.84.69.83.84
= INTEGER: 80
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.6.0.10.72.83.67.65.70.69.84.69.83.84
= INTEGER: 6
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.7.0.10.72.83.67.65.70.69.84.69.83.84
= INTEGER: 1
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.8.0.10.72.83.67.65.70.69.84.69.83.84
= INTEGER: 1
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.9.0.10.72.83.67.65.70.69.84.69.83.84
= STRING: "CAFETEST"
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.10.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 10
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.11.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 3600
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.12.0.10.72.83.67.65.70.69.84.69.83.84
= INTEGER: 0
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.13.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.14.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.15.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 10
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.11.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 3600
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.12.0.10.72.83.67.65.70.69.84.69.83.84
= INTEGER: 0
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.13.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.14.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.15.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.16.0.10.72.83.67.65.70.69.84.69.83.84
= INTEGER: 1
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.17.0.10.72.83.67.65.70.69.84.69.83.84
= Gauge32: 0
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.18.0.10.72.83.67.65.70.69.84.69.83.84
= Counter32: 26014
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.19.0.10.72.83.67.65.70.69.84.69.83.84
= Counter64: 26014
SNMPv2-SMI::enterprises.9.9.161.1.4.1.1.20.0.10.72.83.67.65.70.69.84.69.83.84
= IpAddress: 255.255.255.255
SNMPv2-SMI::enterprises.9.9.161.1.8.1.0 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.161.1.8.2.0 = INTEGER: 2
-----------------------------------------------------------------------------------


Running the following php script produces the following results.

<html><head><title> SLB info</title></head><body>
<?php
$a = snmpwalk("192.168.108.254", "rmsy", ".1.3.6.1.4.1.9.9.161");
for ($i=0; $i < count($a); $i++) {echo " {$a[$i]}<br />";}
?>
</body></html>

-----------------------------------------------------------------------------------
Counter32: 49609797
Counter32: 2776670
Counter32: 26014
Counter32: 26013
Counter32: 26014
Counter32: 6
Counter32: 0
INTEGER: 1
INTEGER: 3
Gauge32: 2
Gauge32: 0
INTEGER: 1
INTEGER: 2
INTEGER: 2
Gauge32: 0
Gauge32: 0
Gauge32: 0
Gauge32: 0
Gauge32: 4294967295
Gauge32: 4294967295
Gauge32: 8
Gauge32: 8
Gauge32: 8
Gauge32: 8
Gauge32: 0
Gauge32: 0
Gauge32: 1
Gauge32: 1
INTEGER: 360
INTEGER: 360
Gauge32: 1
Gauge32: 1
Gauge32: 1
Gauge32: 1
Gauge32: 0
Gauge32: 0
Counter32: 5
Counter32: 2
INTEGER: 1
INTEGER: 1
Counter32: 12890
Counter32: 13123
INTEGER: 2
Gauge32: 7
IpAddress: 192.168.110.110
INTEGER: 80
INTEGER: 6
INTEGER: 1
INTEGER: 1
STRING: "CAFETEST"
Gauge32: 10
Gauge32: 3600
INTEGER: 0
Gauge32: 0
Gauge32: 0
Gauge32: 0
INTEGER: 1
Gauge32: 0
Counter32: 26014
IpAddress: 255.255.255.255
INTEGER: 2
INTEGER: 2
------------------------------------------------------------------------------------------

Most of the indexed items are missing from the output. I believe this is
because 
the php snmpwalk function does not actually call snmpwalk. It uses a
combination
of snmpget and snmpgetnext calls which do not visit every branch in the
MIB tree.

Because the indexes are part of the OID field the output of snmpget and
snmpgetnext
calls are missing vital information.

I would suggest the php snmpwalk function be coded to call the actual
snmpwalk routine. 
There would then be no need for the snmprealwalk and snmpwalkoid
functions.

Reproduce code:
---------------
command line call:
---------------------------------------------------------
snmpwalk -v2c -crmsy 192.168.108.254 .1.3.6.1.4.1.9.9.161


php script:
---------------------------------------------------------
<html><head><title> SLB info</title></head><body>
<?php
$a = snmpwalk("192.168.108.254", "rmsy", ".1.3.6.1.4.1.9.9.161");
for ($i=0; $i < count($a); $i++) {echo " {$a[$i]}<br />";}
?>
</body></html>



-- 
Edit bug report at http://bugs.php.net/?id=32074&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32074&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32074&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32074&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32074&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32074&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32074&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32074&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32074&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32074&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32074&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32074&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32074&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32074&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32074&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32074&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32074&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32074&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32074&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32074&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32074&r=mysqlcfg

Reply via email to