|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-10-18 18:22 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 16:00:02 2025 UTC |
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-