Edit report at https://bugs.php.net/bug.php?id=64159&edit=1
ID: 64159 Updated by: lytbo...@php.net Reported by: loic dot blot at unix-experience dot fr Summary: Truncated snmpget -Status: Closed +Status: Feedback Type: Bug Package: SNMP related Operating System: * PHP Version: 5.4.11 Assigned To: lytboris Block user comment: N Private report: N New Comment: Please try using this snapshot: http://snaps.php.net/php5.4-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2013-05-03 12:08:02] lytbo...@php.net Automatic comment on behalf of lytboris Revision: http://git.php.net/?p=php-src.git;a=commit;h=2c336c9cde524cb6465bbd75924b7e40251aefab Log: Fixed bug #64159 (Truncated snmpget) ------------------------------------------------------------------------ [2013-05-03 12:08:00] lytbo...@php.net Automatic comment on behalf of lytboris Revision: http://git.php.net/?p=php-src.git;a=commit;h=e36adfe94a663bc1eeb5d9d378dc80883de179db Log: Fixed bug #64159 (Truncated snmpget) ------------------------------------------------------------------------ [2013-05-03 09:35:46] lytbo...@php.net Basically this is because of loosy algorithm predicting string length produced by snmp library function that prints OID values. As a walkaround one can set === snmp_set_valueretrieval(SNMP_VALUE_PLAIN); === (or OO API [SNMP Object]->valueretrieval) and then use bin2hex to decode binary string into hex string. ------------------------------------------------------------------------ [2013-02-20 18:40:33] yordan dot yordanov at innologica dot com Happening to me aslo. Here's my reproduction: [root@monitor ~]# snmpwalk -cpublic -v1 192.168.0.232 -On .1.3.6.1.4.1.9.9.46.1.6.1.1.4.10003 .1.3.6.1.4.1.9.9.46.1.6.1.1.4.10003 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 [root@monitor ~]# php -r 'print_r(snmprealwalk("192.168.0.232","public",".1.3.6.1.4.1.9.9.46.1.6.1.1.4.10 003"));' Array ( [SNMPv2-SMI::enterprises.9.9.46.1.6.1.1.4.10003] => Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ) [root@monitor ~]# php -v PHP 5.4.11 (cli) (built: Jan 16 2013 16:51:38) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies [root@monitor ~]# uname -a Linux xxxxxxxx 2.6.32-279.19.1.el6.x86_64 #1 SMP Wed Dec 19 07:05:20 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux [root@monitor ~]# cat /etc/centos-release CentOS release 6.3 (Final) ------------------------------------------------------------------------ [2013-02-06 22:00:27] loic dot blot at unix-experience dot fr do this on a CISCO 2950, 2960, 3750 or 4500 (that's all devices i have tested) with proper community and ip. <?php echo snmpget("192.168.1.1","2c","public","1.3.6.1.4.1.9.9.46.1.6.1.1.4"); ?> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=64159 -- Edit this bug report at https://bugs.php.net/bug.php?id=64159&edit=1