#36196 [Opn]: SNMP_VALUE_PLAIN appears not to be working

From: Date: Sat, 28 Jan 2006 23:38:55 +0000
Subject: #36196 [Opn]: SNMP_VALUE_PLAIN appears not to be working
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92587@lists.php.net to get a copy of this message
ID: 36196 User updated by: pookey@php.net Reported By: pookey@php.net Status: Open Bug Type: SNMP related Operating System: gentoo linux PHP Version: 5.1.2 New Comment: seems perl also works as expected... # cat ./test.pl #!/usr/bin/perl use Net::SNMP; use strict; my ($session, $error); ( $session, $error ) = Net::SNMP->session( -hostname => 'reboot1', -community => 'public', -timeout => 5, -port => 161, -localaddr => '192.168.0.1', -version => 1, ); print $error; my $result = $session->get_request('.1.3.6.1.2.1.2.2.1.6.1'); print $result->{'.1.3.6.1.2.1.2.2.1.6.1'}; print "\n"; # ./test.pl 0x00c0b76a8747 Previous Comments: ------------------------------------------------------------------------ [2006-01-29 00:24:13] pookey@php.net Description: ------------ despite PHP and snmpwalk sharing the same library, they return different results for a query.... # ldd /usr/bin/snmpwalk | grep snmp libnetsnmp.so.5 => /usr/lib/libnetsnmp.so.5 (0xb7ee6000) # ldd /usr/bin/php | grep snmp libnetsnmp.so.5 => /usr/lib/libnetsnmp.so.5 (0xb7616000) Bug #29998 covers this, but was dismissed - I am left wondering how despite using the same library, results differ. According to the documentation, using the SNMP_VALUE_PLAIN should prevent the displayed behaviour. Sorry if I'm missing something. Reproduce code: --------------- # cat ./test.php <?php snmp_set_valueretrieval(SNMP_VALUE_PLAIN); echo snmpget('reboot1', 'public', '.1.3.6.1.2.1.2.2.1.6.1') . "\n"; Expected result: ---------------- # snmpwalk -v 1 -c public reboot2 .1.3.6.1.2.1.2.2.1.6.1 IF-MIB::ifPhysAddress.1 = STRING: 0:c0:b7:6a:c4:96 Actual result: -------------- # php ./test.php À·jG ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36196&edit=1

« previous php.bugs (#92587) next »