From:             ch at westend dot com
Operating system: Debian GNU/Linux
PHP version:      5.0.5
PHP Bug Type:     SNMP related
Bug description:  snmp does not parse OID with string index 

Description:
------------
The SNMP function seem to not know that it is possible
to have string indices like:
 $ snmpwalk -Ir myhost \
   'ASCEND-MIBINET-MIB::internetProfile-Active."cir-1-26"'

which gives:
  ASCEND-MIBINET-MIB::internetProfile-Active."cir-1-26" =
    INTEGER: yes(2)

(keep the single and double quotes in the example!)

It seems that setting the "-Ir" flag is not possible.




Reproduce code:
---------------
$x = snmprealwalk('myhost', 'mypassword', 
    "ASCEND-MIBINET-MIB::internetProfile-Station");
var_export($x); print("\n");

gives:

array (
  'ASCEND-MIBINET-MIB::internetProfile-Station."bras-1-2"' => 'STRING:
"bras-1-2"',
  'ASCEND-MIBINET-MIB::internetProfile-Station."bras-1-3"' => 'STRING:
"bras-1-3"',
  'ASCEND-MIBINET-MIB::internetProfile-Station."bras-1-4"' => 'STRING:
"bras-1-4"',
  'ASCEND-MIBINET-MIB::internetProfile-Station."bras-1-48"' => 'STRING:
"bras-1-48"',
  'ASCEND-MIBINET-MIB::internetProfile-Station."bras-1-5"' => 'STRING:
"bras-1-5"',
  'ASCEND-MIBINET-MIB::internetProfile-Station."bras-1-6"' => 'STRING:
"bras-1-6"',


Numerically this OID looks like:

$ snmpwalk -Ir -On myhost \
 'ASCEND-MIBINET-MIB::internetProfile-Active."cir-1-26"'
.1.3.6.1.4.1.529.23.1.1.1.2.8.99.105.114.45.49.45.50.54 = INTEGER: yes(2)



The MIB definition looks like this:

    mibinternetProfileTable     OBJECT-TYPE
        SYNTAX          SEQUENCE OF MibinternetProfileEntry
        ACCESS          not-accessible
        STATUS          mandatory
        DESCRIPTION     "A list of mibinternetProfile profile entries."
        ::= { mibinternetProfile 1 }

    mibinternetProfileEntry     OBJECT-TYPE
        SYNTAX          MibinternetProfileEntry
        ACCESS          not-accessible
        STATUS          mandatory
        DESCRIPTION     "A mibinternetProfile entry containing objects
that
                         maps to the parameters of mibinternetProfile
profile."
        INDEX           { internetProfile-Station }
        ::= { mibinternetProfileTable 1 }

    MibinternetProfileEntry ::=
        SEQUENCE {
            internetProfile-Station
                DisplayString,
            internetProfile-Active
                INTEGER,
....
    internetProfile-Active      OBJECT-TYPE
        SYNTAX  INTEGER {
                    no (1),
                    yes (2)
                }
        ACCESS  read-write
        STATUS  mandatory
        DESCRIPTION     "A profile can be disabled by setting this field
to no. There is no difference between an inactive pr
        ::= { mibinternetProfileEntry 2 }




Expected result:
----------------
I would have expected to be able to use every OID that the
above snmpwalk returns. But they are claimed to be invalid.

Actual result:
--------------
Warning: snmpget(): Invalid object identifier:
ASCEND-MIBINET-MIB::internetProfile-Station."bras-1-2" in /home/ch/t.php
on line 10


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

Reply via email to