By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,475 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

snmp: string index in OID is considered invalid :-(

P: n/a
Hello

How can I do the following command with PHP?

$ 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)

snmpget() does not like the string index and give "Invalid object identifier",
it seems that something like the "-Ir" flag is missing in PHP as other
entries of this mib can be translated correctly.

Funnily, snmpwalk() does return the string representation itself:
array (
'ASCEND-MIBINET-MIB::internetProfile-Station."bras-1-2"'
=> 'STRING: "bras-1-2"',
...
Does anybody know the trick or do I have write my own OID converter which
would not be hard though as the appended oid numbers are just the strlen()
and the ascii values of the string.

bye,

-christian-
Oct 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
$ 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)


Have you escaped all of the single and/or double quotes correctly in
your PHP snmp*() calls?

---
Steve

Oct 19 '05 #2

P: n/a
Hello

On 2005-10-19 Steve wrote:
$ 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)


Have you escaped all of the single and/or double quotes correctly in
your PHP snmp*() calls?


I tried the following ways, can you imagine more? :)

'ASCEND-MIBINET-MIB::internetProfile-Active."cir-1-26"');
'ASCEND-MIBINET-MIB::internetProfile-Active.\"cir-1-26\"');
'ASCEND-MIBINET-MIB::internetProfile-Active.\\"cir-1-26\\"');
"ASCEND-MIBINET-MIB::internetProfile-Active.\"cir-1-26\"");
"ASCEND-MIBINET-MIB::internetProfile-Active.\\\"cir-1-26\\\"");
"ASCEND-MIBINET-MIB::internetProfile-Active.'cir-1-26'");
"ASCEND-MIBINET-MIB::internetProfile-Active.\'cir-1-26\'");
"ASCEND-MIBINET-MIB::internetProfile-Active.\\'cir-1-26\\'");

bye,

-christian-
Oct 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.