title: PHP SNMP Real Walk returns bad characters
body: <p>I read via PHP function snmp2_real_walk OID value '.1.3.6.1.2.1.17.4.3.1.1' for get MAC address from Cisco switch device. Problem is, that some results (randomly around the 50 results of the 200) return bad characters (yet I have found a mistake if I read only MAC addresses). Ie.:</p>
  
  <p><strong>correct output examples:</strong> </p>
  
  <ul>
  <li>[Dot1dTpFdbAddres] => 30 05 5C 38 A7 8C</li>
  <li>[Dot1dTpFdbAddres] =>  C0 7B BC 0E 56 18  </li>
  </ul>
  
  <p><strong>wrong output examples:</strong> </p>
  
  <ul>
  <li>[Dot1dTpFdbAddres] =>  ,v�?.b  (HEX DUMP: 0 : 20 2c 76 8a 3f 2e 62 20 [ ,v.?.b ])</li>
  <li>[Dot1dTpFdbAddres] =>  ,A8��7  (HEX DUMP: 0 : 20 2c 41 38 82 d9 37 20 [ ,A8..7 ])</li>
  <li>[Dot1dTpFdbAddres] =>  xE�<em>\ � (HEX DUMP: 0 : 20 78 45 c4 2a 5c 20 d9 20 [ xE.</em>\ . ])</li>
  </ul>
  
  <p>If I try read OID '.1.3.6.1.2.1.17.4.3.1.1' from program Getif, I have got correct results.</p>
  
  <p>I can't find solution for this problem - can you please help me?</p>
  
  <p><strong>The tested solution that fails</strong></p>
  
  <ul>
  <li>PHP - Chnaged snmp2_real_walk by snmprealwalk</li>
  <li>Changed encoding of files (UTF8, ANSI)</li>
  <li>SNMP longer timeout and try add PHP sleep() function</li>
  <li>PHP directive: snmp_set_oid_numeric_print(1)</li>
  <li>PHP directive: snmp_set_quick_print(true)</li>
  <li>PHP directive: snmp_set_enum_print(true)</li>
  <li>PHP directive: snmp_set_valueretrieval(SNMP_VALUE_LIBRARY and SNMP_VALUE_PLAIN)</li>
  </ul>
  
  <p><strong>About server:</strong></p>
  
  <ul>
  <li>PHP Version 5.5.3</li>
  <li>Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.3 </li>
  <li>LAMP are equivalent to WAMP (error too)</li>
  </ul>
  
  <p><strong>New important informations:</strong></p>
  
  <pre><code>Device return randomly none-hex value for hex values, ie.:
  [iso.3.6.1.2.1.17.4.3.1.1.92.38.10.129.123.27] =&gt; Hex-STRING: 5C 26 0A 81 7B 1B 
  [iso.3.6.1.2.1.17.4.3.1.1.120.69.196.42.25.241] =&gt; Hex-STRING: 78 45 C4 2A 19 F1 
  [iso.3.6.1.2.1.17.4.3.1.1.120.69.196.42.27.169] =&gt; Hex-STRING: 78 45 C4 2A 1B A9 
  [iso.3.6.1.2.1.17.4.3.1.1.120.69.196.42.34.45] =&gt; STRING: "xE�*\"-"
  [iso.3.6.1.2.1.17.4.3.1.1.120.172.192.142.199.214] =&gt; STRING: "x�����"
  [iso.3.6.1.2.1.17.4.3.1.1.124.30.179.254.9.201] =&gt; Hex-STRING: 7C 1E B3 FE 09 C9 
  </code></pre>
  
  <p>Mibs are imported correctly to Apache server, devices look fine.</p>
  
  <p><strong>Is there a way in PHP how to write for snmp2_real_walk() all returned values as Hex-STRING?</strong> </p>
  
  <p>*Similar problems (without results):</p>
  
  <ul>
  <li><p><a href="http://forums.cacti.net/viewtopic.php?f=15&amp;t=50806" rel="nofollow">http://forums.cacti.net/viewtopic.php?f=15&amp;t=50806</a></p></li>
  <li><p><a href="http://comments.gmane.org/gmane.network.net-snmp.user/31569" rel="nofollow">http://comments.gmane.org/gmane.network.net-snmp.user/31569</a></p></li>
  <li><p><a href="http://forums.cacti.net/viewtopic.php?f=21&amp;t=46068" rel="nofollow">http://forums.cacti.net/viewtopic.php?f=21&amp;t=46068</a>*</p></li>
  </ul>
  
  <p>Thanks and best regards,
   Petr</p>