|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36196 SNMP_VALUE_PLAIN appears not to be working
Submitted: 2006-01-29 00:24 UTC Modified: 2007-07-17 01:00 UTC
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: Assigned:
Status: No Feedback Package: SNMP related
PHP Version: 5.1.2 OS: gentoo linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2006-01-29 00:24 UTC]
despite PHP and snmpwalk sharing the same library, they   
return different results for a query....   
# ldd /usr/bin/snmpwalk | grep snmp   => /usr/lib/   
# ldd /usr/bin/php | grep snmp   => /usr/lib/   
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
echo snmpget('reboot1', 'public', '.') . "\n";

Expected result:
# snmpwalk -v 1 -c public  
reboot2 .  
IF-MIB::ifPhysAddress.1 = STRING: 0:c0:b7:6a:c4:96  

Actual result:
# php ./test.php 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-29 00:38 UTC]
seems perl also works as expected...  
# cat ./   
use Net::SNMP;   
use strict;   
my ($session, $error);   
( $session, $error ) = Net::SNMP->session(   
        -hostname       => 'reboot1',   
        -community      => 'public',   
        -timeout        => 5,   
        -port           => 161,   
        -localaddr      => '',   
        -version        => 1,   
print $error;   
my $result =   
print $result->{'.'};   
print "\n";   
# ./   
 [2006-12-19 15:54 UTC] cesarmata2000 at cantv dot net
Test with that

//Bug #36196  	SNMP_VALUE_PLAIN
$mac = snmpget("",'public',".");

$mac = str_replace('""',"&nbsp;",$mac);
$mac = str_replace('Hex: ',"",$mac);
$mac = str_replace(' ',":",trim($mac));

print $mac;
 [2007-07-09 13:43 UTC]
Try the above script. And also check the sources, perhaps you misunderstood how this works..
 [2007-07-09 13:43 UTC]
Also, update to latest 5.2 CVS first. :)
 [2007-07-17 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 08:01:32 2024 UTC