|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53862 snmp_set_oid_output_format does not allow returning to default etc
Submitted: 2011-01-28 00:18 UTC Modified: 2012-02-25 09:43 UTC
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: mloftis at wgops dot com Assigned: lytboris (profile)
Status: No Feedback Package: SNMP related
PHP Version: 5.3.5 OS: Irrelevant
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:
From: mloftis at wgops dot com
New email:
PHP Version: OS:


 [2011-01-28 00:18 UTC] mloftis at wgops dot com
snmp_set_oid_output_format only allows using the FULL (SNMP_OID_OUTPUT_FULL) or 
NUMERIC (SNMP_OID_OUTPUT_NUMERIC) setting types, neither of which is the default.  
It also has no corresponding _get_ function call to query/store and return the 
setting back to "whatever it was before I touched it"

I've attached a patch which does both (from the 5.3 branch), extends the existing 
function to include the available types in UCD Net-SNMP as of 5.4 (not 
verified/checked against older ones, have not verified that setting to _NONE will 
not cause crashes).

Test script:
$rvDefault = snmp2_get('','public','.');

$rvFull = snmp2_get('','public','.');

$rvNumeric = snmp2_get('','public','.');

echo $rvDefault."\n";
echo $rvFull."\n";
echo $rvNumeric."\n";

Expected result:
Setting either SNMP_OID_OUTPUT_FULL or SNMP_OID_OUTPUT_NUMERIC would return the 
library to it's default.  Expect there to be an snmp_get_oid_output_format call as 
well to query the current setting.

Actual result:
Neither of the available snmp_set_oid_output_format constants can return the 
library to it's default settings.  No ability to query the library for the current 


ext-snmp-output-extensions (last revision 2011-01-27 23:19 UTC by mloftis at wgops dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-31 12:53 UTC]
-Status: Open +Status: Feedback
 [2011-01-31 12:53 UTC]
Please try using this snapshot:
For Windows:

Please check OO API from trunk. It has an option to specify session-wise OID output format and more.

Sources in trunk can be compiled against downto php 5.2
 [2011-01-31 12:54 UTC]
-Assigned To: +Assigned To: lytboris
 [2012-02-25 09:43 UTC]
-Status: Feedback +Status: No Feedback
 [2012-02-25 09:43 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 17:01:44 2024 UTC