Edit report at http://bugs.php.net/bug.php?id=34910&edit=1

 ID:                 34910
 Updated by:         [email protected]
 Reported by:        ch at westend dot com
 Summary:            OID not parsed with invalid string index
-Status:             Open
+Status:             Bogus
 Type:               Feature/Change Request
 Package:            SNMP related
 Operating System:   Debian GNU/Linux
 PHP Version:        5CVS-2005-11-02 (snap)
-Assigned To:        
+Assigned To:        lytboris
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.




Previous Comments:
------------------------------------------------------------------------
[2005-11-02 13:59:56] ch at westend dot com

What about beeing a bit more polite, eh?



I tried the latest snapshot and the problem apparently has not been
fixed in the meantime or you have to tell me where my syntax is wrong.



$ snmpget -v 1 -Ir -c XXXX stinger-test
'ASCEND-MIBINET-MIB::internetProfile-Station."cir-1-9"'



ASCEND-MIBINET-MIB::internetProfile-Station."cir-1-9" = STRING:
"cir-1-9"



$ cat t.php

<?php

print snmpget("stinger-test.westend.com", XXXXX, 

'ASCEND-MIBINET-MIB::internetProfile-Station."cir-1-9"')."\n";

?>





ch@xeniac:/tmp/php5-200511020730$ ./sapi/cli/php ~ch/t.php 



Warning: snmpget(): Invalid object identifier:
ASCEND-MIBINET-MIB::internetProfile-Station."cir-1-9" in /home/ch/t.php
on line 4





bye,



-christian-

------------------------------------------------------------------------
[2005-10-18 18:22:45] ch at westend dot com

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 this bug report at http://bugs.php.net/bug.php?id=34910&edit=1

Reply via email to