|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-05-11 05:30 UTC] jorgen at overload dot org
According to the documentation the snmp_set_quick_print() function when set to true should make it possible for snmpget() to get returned only the snmp oid values, thus without the snmp oid itself. This suddenly stopped working when i upgraded to php4.2 Could anyone look into this one? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 17:00:02 2025 UTC |
I am having the same issue. I built php 4.2.2 under Solaris 8, using ucd snmp 4.2.5. The problem is that the default for the snmp functions is to return values that contain the oid value, an equals sign, sometimes a type, and then the value. (Not very useful IMO.) The documentation for snmp_set_quick_print() implies that it can be used to suppress the oid and other junk, but it only suppresses the equals sign and the type. The oid is still included. For example: snmp_set_quick_print(0); echo snmpget("3600.sheetz.com", "public", "system.sysDescr.0"); prints: system.sysDescr.0 = Cisco Internetwork Operating System Software IOS (tm) 3600 Software (C3640-JO3S56I-M), Version 12.1(1.5)T, MAINTENANCE INTERIM SOFTWARE Copyright (c) 1986-2000 by cisco Systems, Inc. Compiled Mon 24-Apr-00 14:58 by phanguye and snmp_set_quick_print(1); echo snmpget("3600.sheetz.com", "public", "system.sysDescr.0"); returns this: system.sysDescr.0 Cisco Internetwork Operating System Software IOS (tm) 3600 Software (C3640-JO3S56I-M), Version 12.1(1.5)T, MAINTENANCE INTERIM SOFTWARE Copyright (c) 1986-2000 by cisco Systems, Inc. Compiled Mon 24-Apr-00 14:58 by phanguye It's the same thing without the equals sign. It should return: Cisco Internetwork Operating System Software IOS (tm) 3600 Software (C3640-JO3S56I-M), Version 12.1(1.5)T, MAINTENANCE INTERIM SOFTWARE Copyright (c) 1986-2000 by cisco Systems, Inc. Compiled Mon 24-Apr-00 14:58 by phanguye After looking at the PHP source code (snmp.c), it looks like PHP does nothing with the parameter passed to the snmp_set_quick_print function. It's just passed to the snmp library. I assume that this means the problem is probably in the library and not in php. I don't have a lot of time to investigate so I could be totally wrong.